1- # Easy logs with rotations
1+ # Simple python logs with file rotation
22
33[ ![ Donate] ( https://img.shields.io/badge/Donate-PayPal-brightgreen.svg?style=plastic )] ( https://www.paypal.com/ncp/payment/6G9Z78QHUD4RJ )
4- [ ![ License] ( https://img.shields.io/pypi/l/pythonLogs )] ( https://github.com/ddc/pythonLogs/blob/main/LICENSE )
4+ [ ![ License: MIT ] ( https://img.shields.io/badge/License-MIT-yellow.svg )] ( https://opensource.org/licenses/MIT )
55[ ![ PyPi] ( https://img.shields.io/pypi/v/pythonLogs.svg )] ( https://pypi.python.org/pypi/pythonLogs )
66[ ![ PyPI Downloads] ( https://static.pepy.tech/badge/pythonLogs )] ( https://pepy.tech/projects/pythonLogs )
77[ ![ codecov] ( https://codecov.io/gh/ddc/pythonLogs/graph/badge.svg?token=QsjwsmYzgD )] ( https://codecov.io/gh/ddc/pythonLogs )
1111
1212
1313
14- # Logs
15- + Parameters for all classes are declared as OPTIONAL
14+ # Notes
15+ + Arguments for all classes are declared as OPTIONAL
16+ + arguments takes priority over environment variables
1617+ If any [ .env] ( ./pythonLogs/.env.example ) variable is omitted, it falls back to default values here: [ settings.py] ( pythonLogs/settings.py )
17- + Function arguments will overwrite any env variable
1818+ Timezone parameter can also accept ` localtime ` , default to ` UTC `
1919 + This parameter is only to display the timezone datetime inside the log file
2020 + For timed rotation, only UTC and localtime are supported, meaning it will rotate at UTC or localtime
@@ -34,7 +34,7 @@ pip install pythonLogs
3434
3535# BasicLog
3636+ Setup Logging
37- + This is just a basic log, it does not use any file
37+ + This is just a basic log, it does not use any file
3838``` python
3939from pythonLogs import BasicLog
4040logger = BasicLog(
@@ -54,9 +54,9 @@ logger.warning("This is a warning example")
5454
5555# SizeRotatingLog
5656+ Setup Logging
57- + Logs will rotate based on the file size using the ` maxmbytes ` variable
58- + Rotated logs will have a sequence number starting from 1: ` app.log_1.gz, app.log_2.gz `
59- + Logs will be deleted based on the ` daystokeep ` variable, defaults to 30
57+ + Logs will rotate based on the file size using the ` maxmbytes ` variable
58+ + Rotated logs will have a sequence number starting from 1: ` app.log_1.gz, app.log_2.gz `
59+ + Logs will be deleted based on the ` daystokeep ` variable, defaults to 30
6060``` python
6161from pythonLogs import SizeRotatingLog
6262logger = SizeRotatingLog(
@@ -81,12 +81,12 @@ logger.warning("This is a warning example")
8181
8282# TimedRotatingLog
8383+ Setup Logging
84- + Logs will rotate based on ` when ` variable to a ` .gz ` file, defaults to ` midnight `
85- + Rotated log will have the sufix variable on its name: ` app_20240816.log.gz `
86- + Logs will be deleted based on the ` daystokeep ` variable, defaults to 30
87- + Current 'when' events supported:
88- + midnight — roll over at midnight
89- + W{0-6} - roll over on a certain day; 0 - Monday
84+ + Logs will rotate based on ` when ` variable to a ` .gz ` file, defaults to ` midnight `
85+ + Rotated log will have the sufix variable on its name: ` app_20240816.log.gz `
86+ + Logs will be deleted based on the ` daystokeep ` variable, defaults to 30
87+ + Current 'when' events supported:
88+ + midnight — roll over at midnight
89+ + W{0-6} - roll over on a certain day; 0 - Monday
9090``` python
9191from pythonLogs import TimedRotatingLog
9292logger = TimedRotatingLog(
@@ -144,7 +144,7 @@ poetry build -f wheel
144144# Run Tests and Get Coverage Report using Poe
145145``` shell
146146poetry update --with test
147- poe tests
147+ poe test
148148```
149149
150150
0 commit comments