-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Apply tracking logs and logging config. * Adjusts in CLI and logging.conf. * Some adjusts. * Change version to generate new dev package * Fix version. * Apply style. * Add new assert in the migrate unit test.
- Loading branch information
Showing
13 changed files
with
181 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
"""Module docstring example, following Google's docstring style.""" | ||
import logging.config | ||
import os | ||
import sys | ||
|
||
sys.path.insert(0, os.path.abspath(".")) | ||
|
||
logging.config.fileConfig(fname="butterfree/logging.conf") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +0,0 @@ | ||
import logging | ||
|
||
|
||
def __logger(name: str) -> logging.Logger: | ||
format_ = "%(name)s:%(asctime)-15s:%(levelname)s:< %(message)s >" | ||
logging.basicConfig(format=format_, level=logging.INFO) | ||
return logging.getLogger(name) | ||
|
||
|
||
cli_logger = __logger("butterfree") | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
[loggers] | ||
keys=root,cli,migrate,database_migrate | ||
|
||
[handlers] | ||
keys=consoleHandler,file | ||
|
||
[formatters] | ||
keys=simpleFormatter,jsonFormatter | ||
|
||
[logger_root] | ||
level=DEBUG | ||
handlers=consoleHandler | ||
|
||
[logger_cli] | ||
level=DEBUG | ||
handlers=file | ||
qualname=cli | ||
propagate=0 | ||
|
||
[logger_migrate] | ||
level=DEBUG | ||
handlers=file | ||
qualname=migrate | ||
propagate=0 | ||
|
||
[logger_database_migrate] | ||
level=DEBUG | ||
handlers=file | ||
qualname=database_migrate | ||
propagate=0 | ||
|
||
[handler_consoleHandler] | ||
class=StreamHandler | ||
level=DEBUG | ||
formatter=simpleFormatter | ||
args=(sys.stdout,) | ||
|
||
[handler_file] | ||
class=FileHandler | ||
level=DEBUG | ||
formatter=jsonFormatter | ||
args=('logs/logging.json', "a") | ||
|
||
[formatter_simpleFormatter] | ||
format=%(name)s:%(asctime)-15s:%(levelname)s:%(message)s | ||
datefmt= | ||
class=logging.Formatter | ||
|
||
[formatter_jsonFormatter] | ||
format={"name": "%(name)s", "timestamp": "%(asctime)-15s", "level": "%(levelname)s", "message": "%(message)s"} | ||
datefmt= | ||
class=logging.Formatter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters