logcu.py 462 B

123456789101112131415161718192021222324
  1. # -*- coding: utf-8 -*-
  2. import datetime
  3. import codecs
  4. class Logcu:
  5. global log
  6. def __init__(self):
  7. log=""
  8. def hata(self,mesaj):
  9. print "HATA:",mesaj
  10. def uyari(self,mesaj):
  11. print "UYARI:",mesaj
  12. def bilgi(self,mesaj):
  13. print "BILGI:",mesaj
  14. def yaz(self,kull="sistem",ack="",tip="BILGI"):
  15. codecs.open("log//log.txt",'a').write(str(datetime.datetime.now())[0:19]+"--->"+tip+": "+str(kull)+"@"+str(ack)+"\n")