Skip to content

Commit

Permalink
concerns #12, concerns #6; add barebone configuration for logger
Browse files Browse the repository at this point in the history
  • Loading branch information
thealphadollar committed Oct 17, 2018
1 parent 597bd3f commit 16839f3
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,4 @@ venv.bak/
# mypy
.mypy_cache/
.idea/
./logs/*
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
### DirStructure

--> Repo <br/>
* ---> logs <br/>
* ---> backend.log <br/>
* ---> frontend.log <br/>
* ---> src <br/>
* ---> config <br/>
* ---> stores important configuration files
* ---> loggerConfig.yaml
* ---> frontend <br/>
* ---> all the code using HTML, JS for frontend <br/>
* ---> dockerfile <br/>
Expand Down
40 changes: 40 additions & 0 deletions src/config/loggerConfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
# The file stores logging configuration
# NOTE: Log address provided relative to repo directory
version: 0.5
disable_existing_loggers: True
formatters:
simple:
format: "%(asctime)s [%(name)s] [%(levelname)-8s] %(message)s"
datefmt: '%m/%d/%Y %I:%M:%S %p'
colored:
"()": coloredlogs.ColoredFormatter
format: "%(asctime)s [%(name)s] [%(levelname)-8s] %(message)s"
datefmt: '%m/%d/%Y %H:%M:%S'
handlers:
console:
class: logging.StreamHandler
formatter: colored
stream: ext://sys.stdout
level: INFO
backend_file:
class: logging.FileHandler #TODO: to be updated
formatter: simple
filename: logs/backend.log
level: DEBUG
frontend_file:
class: logging.FileHandler #TODO: to be updated
formatter: simple
filename: logs/frontend.log
level: DEBUG
root:
level: DEBUG
handlers: [console]
loggers:
backend:
level: DEBUG
handlers: [console, backend_file]
frontend:
level: DEBUG
handler: [console, frontend_file]
...

0 comments on commit 16839f3

Please sign in to comment.