5 def __init__(self,file_path=u'C:/mobile_gtd.log',log_level = 8):
7 self.file_path = file_path
8 self.file_path = 'C:/Data/GTD/mobile_gtd.log'
9 self.log_level = log_level
10 #self.log_file = file(io.os_encode(file_path),'w')
11 io.create_file(self.file_path).close
12 self.log_file = file(self.file_path,'a')
15 self.old_stderr = sys.stderr
16 sys.stderr = self.log_file
17 sys.stderr.write('stderr logged from logging\n')
20 def unlog_stderr(self):
22 sys.stderr = self.old_stderr
23 def log(self,text,level=0):
24 if level < self.log_level:
25 self.log_file.write(io.os_encode(text)+'\n')
30 self.log(u'Closing log')
37 def __init__(self,log_level = 8):
38 self.log_level = log_level
39 def log(self,text,level=0):
41 if level < self.log_level:
42 appuifw.note(u''+repr(text))
47 def log(self,text,level=0):
54 #logger=FileLogger(gtd_directory+'gtd.log')
55 # Need NullLogger during initialization of FileLogger
58 #logger=ConsoleLogger()