Skip to content

Commit 1847f33

Browse files
committed
refactor(logging): remove unnecessary blank lines in formatter classes
Remove extra blank lines in the CustomFormatter, ConsoleFormatter, and JSONFormatter classes for cleaner code formatting. refactor(main): adjust log format adapter initialization Move the initialization of the log format adapter out of the startup event in app/main.py for better code clarity and structure. Add logging for the current logging format at startup.
1 parent cae6028 commit 1847f33

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

tracardi/service/logging/formater.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
import logging
33

44

5-
65
class CustomFormatter(logging.Formatter):
7-
86
white = "\x1b[97m"
97
grey = "\x1b[37m"
108
yellow = "\x1b[33;20m"
@@ -26,6 +24,7 @@ def format(self, record):
2624
formatter = logging.Formatter(log_fmt)
2725
return formatter.format(record)
2826

27+
2928
class ConsoleFormatter(logging.Formatter):
3029
format = "%(asctime)s [%(levelname)s] %(message)s | %(name)s | %(filename)s | %(lineno)d"
3130

@@ -43,7 +42,6 @@ def format(self, record):
4342
return formatter.format(record)
4443

4544

46-
4745
class JSONFormatter(logging.Formatter):
4846
def format(self, record):
4947
# Ensure asctime and message are computed
@@ -59,4 +57,3 @@ def format(self, record):
5957
"lineno": record.lineno,
6058
}
6159
return json.dumps(log_record)
62-

0 commit comments

Comments
 (0)