Subversion Repositories SmartDukaan

Rev

Rev 19284 | Rev 19491 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 19284 Rev 19413
Line 138... Line 138...
138
		You should override this method when you subclass Daemon. It will be called after the process has been
138
		You should override this method when you subclass Daemon. It will be called after the process has been
139
		daemonized by start() or restart().
139
		daemonized by start() or restart().
140
		"""
140
		"""
141
		pass
141
		pass
142
def configure_logging(logfile):
142
def configure_logging(logfile):
143
    fh = logging.FileHandler(logfile, 'w')
-
 
144
    formatter = logging.Formatter(logging.BASIC_FORMAT)
-
 
145
    fh.setFormatter(formatter)
-
 
146
    root = logging.getLogger()
-
 
147
    root.setLevel(logging.ERROR)
-
 
148
    root.addHandler(fh)
-
 
149
143
	if logfile is None:
-
 
144
		return
-
 
145
	fh = logging.FileHandler(logfile, 'w')
-
 
146
	formatter = logging.Formatter(logging.BASIC_FORMAT)
-
 
147
	fh.setFormatter(formatter)
-
 
148
	root = logging.getLogger()
-
 
149
	root.setLevel(logging.ERROR)
-
 
150
	root.addHandler(fh)
-
 
151
150
152