Log last command line action to log/cmd.log
This commit is contained in:
parent
7cc408de4c
commit
fcd4253a8d
1 changed files with 5 additions and 1 deletions
|
@ -55,7 +55,11 @@ if config.action == "main":
|
||||||
level=logging.DEBUG, stream=helper.openLocked(log_file_path, "a")
|
level=logging.DEBUG, stream=helper.openLocked(log_file_path, "a")
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
logging.basicConfig(level=logging.DEBUG, stream=open(os.devnull, "w")) # No file logging if action is not main
|
log_file_path = "%s/cmd.log" % config.log_dir
|
||||||
|
logging.basicConfig(
|
||||||
|
format='[%(asctime)s] %(levelname)-8s %(name)s %(message)s',
|
||||||
|
level=logging.DEBUG, stream=open(log_file_path, "w")
|
||||||
|
)
|
||||||
|
|
||||||
# Console logger
|
# Console logger
|
||||||
console_log = logging.StreamHandler()
|
console_log = logging.StreamHandler()
|
||||||
|
|
Loading…
Reference in a new issue