Here are the examples of the python api twisted.logger.textFileLogObserver taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
3
Example 1
def init(outFile):
level = levels[config.LOG_LEVEL]
predicate = LogLevelFilterPredicate(defaultLogLevel=level)
observer = FilteringLogObserver(textFileLogObserver(outFile=outFile), [predicate])
observer._encoding = "utf-8"
globalLogPublisher.addObserver(observer)
log.info("Start logging with {l}", l=level)
0
Example 2
def audit():
outFile = sys.stdout if config.LOG_DIRECTORY == "stdout" else daily("audit.log")
observer = textFileLogObserver(outFile=outFile)
observer._encoding = "utf-8"
return Logger(observer=observer)