Skip to content

Commit 1ee758e

Browse files
committed
v3.0.11
1 parent 86d7a5a commit 1ee758e

File tree

5 files changed

+70
-78
lines changed

5 files changed

+70
-78
lines changed

.github/workflows/workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test, Build, Create a Release and Publish to PyPI
1+
name: Test, Build, Release, Publish
22

33
on:
44
push:

README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
# Logs
1515
+ Parameters for all classes are declared as OPTIONAL
1616
+ If any [.env](./ddcLogs/.env.example) variable is omitted, it falls back to default values here: [settings.py](ddcLogs/settings.py)
17-
+ timezone parameter can also accept `localtime`, default to `UTC`
17+
+ Function arguments will overwrite any env variable
18+
+ Timezone parameter can also accept `localtime`, default to `UTC`
1819
+ This parameter is only to display the timezone datetime inside the log file
1920
+ For timed rotation, only UTC and localtime are supported, meaning it will rotate at UTC or localtime
2021
+ env variable to change between UTC and localtime is `LOG_ROTATE_AT_UTC` and default to True
21-
+ streamhandler parameter will add stream handler along with file handler
22-
+ showlocation parameter will show the filename and the line number where the message originated
22+
+ Streamhandler parameter will add stream handler along with file handler
23+
+ Showlocation parameter will show the filename and the line number where the message originated
2324

2425

2526

@@ -39,8 +40,6 @@ from ddcLogs import BasicLog
3940
logger = BasicLog(
4041
level="debug",
4142
name="app",
42-
encoding="UTF-8",
43-
datefmt="%Y-%m-%dT%H:%M:%S",
4443
timezone="America/Sao_Paulo",
4544
showlocation=False,
4645
).init()
@@ -67,8 +66,6 @@ logger = SizeRotatingLog(
6766
filenames=["main.log", "app1.log"],
6867
maxmbytes=5,
6968
daystokeep=7,
70-
encoding="UTF-8",
71-
datefmt="%Y-%m-%dT%H:%M:%S",
7269
timezone="America/Chicago",
7370
streamhandler=True,
7471
showlocation=False
@@ -98,10 +95,7 @@ logger = TimedRotatingLog(
9895
directory="/app/logs",
9996
filenames=["main.log", "app2.log"],
10097
when="midnight",
101-
sufix="%Y%m%d",
10298
daystokeep=7,
103-
encoding="UTF-8",
104-
datefmt="%Y-%m-%dT%H:%M:%S",
10599
timezone="UTC",
106100
streamhandler=True,
107101
showlocation=False
@@ -115,7 +109,7 @@ logger.warning("This is a warning example")
115109

116110

117111

118-
## Env Variables
112+
## Env Variables (Optional)
119113
```
120114
LOG_LEVEL=DEBUG
121115
LOG_TIMEZONE=America/Chicago
@@ -134,7 +128,6 @@ LOG_MAX_FILE_SIZE_MB=10
134128
# TimedRotatingLog
135129
LOG_ROTATE_WHEN=midnight
136130
LOG_ROTATE_AT_UTC=True
137-
LOG_ROTATE_FILE_SUFIX=%Y%m%d
138131
```
139132

140133

ddcLogs/.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ LOG_MAX_FILE_SIZE_MB=10
1515
# TimedRotatingLog
1616
LOG_ROTATE_WHEN=midnight
1717
LOG_ROTATE_AT_UTC=True
18-
LOG_ROTATE_FILE_SUFIX=%Y%m%d

0 commit comments

Comments
 (0)