This is an automated email from the ASF dual-hosted git repository.
mykolabodnar pushed a commit to branch DATALAB-2409
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
The following commit(s) were added to refs/heads/DATALAB-2409 by this push:
new 66e99b8 [DATALAB-2409] - logging refactored
66e99b8 is described below
commit 66e99b8570b70d7275fdfd2bdbdcd7fb60df21f0
Author: bodnarmykola <[email protected]>
AuthorDate: Tue Aug 3 11:21:03 2021 +0300
[DATALAB-2409] - logging refactored
---
infrastructure-provisioning/src/general/lib/os/logger.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/infrastructure-provisioning/src/general/lib/os/logger.py
b/infrastructure-provisioning/src/general/lib/os/logger.py
index 6ffeaee..f4c5869 100644
--- a/infrastructure-provisioning/src/general/lib/os/logger.py
+++ b/infrastructure-provisioning/src/general/lib/os/logger.py
@@ -24,10 +24,11 @@ import os
local_log_filename = "{}_{}.log".format(os.environ['conf_resource'],
os.environ['request_id'])
local_log_filepath = "/logs/" + os.environ['conf_resource'] + "/" +
local_log_filename
-logging.basicConfig(format='%(levelname)-8s [%(asctime)s] %(message)s',
+logger = logging
+logger.basicConfig(format='%(levelname)-8s [%(asctime)s] %(message)s',
level=logging.DEBUG,
filename='{}'.format(local_log_filepath),
filemode='w')
console = logging.StreamHandler()
console.setLevel(logging.INFO)
-logger = logging.getLogger('').addHandler(console)
\ No newline at end of file
+logger.getLogger('').addHandler(console)
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]