-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michael J. Wilson
committed
Feb 2, 2024
1 parent
3158ea8
commit cc6efd0
Showing
3 changed files
with
53 additions
and
14 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[loggers] | ||
keys=root,foundation | ||
|
||
[handlers] | ||
keys=consoleHandler | ||
|
||
[formatters] | ||
keys=simpleFormatter | ||
|
||
[logger_root] | ||
level=DEBUG | ||
handlers=consoleHandler | ||
|
||
[logger_foundation] | ||
level=DEBUG | ||
handlers=consoleHandler | ||
qualname=foundation | ||
propagate=0 | ||
|
||
[handler_consoleHandler] | ||
class=StreamHandler | ||
level=DEBUG | ||
formatter=simpleFormatter | ||
args=(sys.stdout,) | ||
|
||
[formatter_simpleFormatter] | ||
format=%(name)s @ %(asctime)s - %(levelname)s - %(message)s |
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,21 @@ | ||
from __future__ import annotations | ||
|
||
import logging | ||
import logging.config | ||
|
||
from foundation.tools import calculate_pi | ||
|
||
logging.config.fileConfig("logging.conf") | ||
|
||
|
||
logger = logging.getLogger("FOUNDATION") | ||
|
||
pi = calculate_pi(6) | ||
|
||
logger.debug("debug message") | ||
logger.info("info message") | ||
logger.warning("warn message") | ||
logger.error("error message") | ||
logger.critical("critical message") | ||
|
||
logger.info("Found pi to be {pi}", extra={"pi": pi}) |
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