https://github.com/badsyntax/python-logging
https://github.com/badsyntax/python-logging
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/badsyntax/python-logging
- Owner: badsyntax
- Created: 2024-12-07T10:37:23.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-07T11:23:54.000Z (about 1 year ago)
- Last Synced: 2025-08-13T01:29:22.049Z (6 months ago)
- Language: Python
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# python-logging
Exploring different approaches to logging.
## Examples
Example1:
```shell
❯ python example1_explicit.py
INFO:models:Costings:Running model
INFO:root:CostingsModel took 0.3s
INFO:models:Expenses:Running model
INFO:root:ExpensesModel took 0.4s
```
Example2:
```shell
❯ python example2_decorators.py
INFO:models:Costings:Running model
INFO:models:Costings:run_model took 0.56s
INFO:models:Expenses:Running model
INFO:models:Expenses:run_model took 0.13s
```
Example 3:
```shell
❯ python example3_funcname.py
2024-12-07 11:22:49,508 - INFO - CostingsModel.py - run_model - Running model
2024-12-07 11:22:50,253 - INFO - example3_funcname.py - - CostingsModel took 0.75s
2024-12-07 11:22:50,253 - INFO - ExpensesModel.py - run_model - Running model
2024-12-07 11:22:50,698 - INFO - example3_funcname.py - - ExpensesModel took 0.45s
```