File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
packages/opal-common/opal_common Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,11 @@ class OpalCommonConfig(Confi):
40
40
LOG_SERIALIZE = confi .bool (
41
41
"LOG_SERIALIZE" , False , description = "Serialize log messages"
42
42
)
43
+ LOG_PIPE_TO_STDERR = confi .bool (
44
+ "LOG_PIPE_TO_STDERR" ,
45
+ True ,
46
+ description = "Should we send logs to stderr? otherwise to stdout" ,
47
+ )
43
48
LOG_SHOW_CODE_LINE = confi .bool (
44
49
"LOG_SHOW_CODE_LINE" , True , description = "Show code line in log messages"
45
50
)
@@ -68,6 +73,7 @@ class OpalCommonConfig(Confi):
68
73
LOG_TO_FILE = confi .bool (
69
74
"LOG_TO_FILE" , False , description = "Should we log to a file"
70
75
)
76
+
71
77
LOG_FILE_PATH = confi .str (
72
78
"LOG_FILE_PATH" ,
73
79
f"opal_{ PROCESS_NAME } {{time}}.log" ,
Original file line number Diff line number Diff line change @@ -29,8 +29,9 @@ def configure_logs():
29
29
# Clean slate
30
30
logger .remove ()
31
31
# Logger configuration
32
+ pipe = sys .stderr if opal_common_config .LOG_PIPE_TO_STDERR else sys .stdout
32
33
logger .add (
33
- sys . stderr ,
34
+ pipe ,
34
35
filter = filter .filter ,
35
36
format = formatter .format ,
36
37
level = opal_common_config .LOG_LEVEL ,
You can’t perform that action at this time.
0 commit comments