aboutsummaryrefslogtreecommitdiffstats
path: root/modules/logging_config.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-08-09 17:49:33 +0000
committerAUTOMATIC1111 <16777216c@gmail.com>2023-08-09 17:49:33 +0000
commitedfae9e78af23bdd6161c55c7ec88533de8925f8 (patch)
tree2659368f56fc6ba8616c53c6c9724140ced98859 /modules/logging_config.py
parentc7b9394daf9efc5da8e56007199c3fc3e7439f92 (diff)
downloadstable-diffusion-webui-gfx803-edfae9e78af23bdd6161c55c7ec88533de8925f8.tar.gz
stable-diffusion-webui-gfx803-edfae9e78af23bdd6161c55c7ec88533de8925f8.tar.bz2
stable-diffusion-webui-gfx803-edfae9e78af23bdd6161c55c7ec88533de8925f8.zip
add --loglevel commandline argument for logging
remove the progressbar for extension installation in favor of logging output
Diffstat (limited to 'modules/logging_config.py')
-rw-r--r--modules/logging_config.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/logging_config.py b/modules/logging_config.py
new file mode 100644
index 00000000..7db23d4b
--- /dev/null
+++ b/modules/logging_config.py
@@ -0,0 +1,16 @@
+import os
+import logging
+
+
+def setup_logging(loglevel):
+ if loglevel is None:
+ loglevel = os.environ.get("SD_WEBUI_LOG_LEVEL")
+
+ if loglevel:
+ log_level = getattr(logging, loglevel.upper(), None) or logging.INFO
+ logging.basicConfig(
+ level=log_level,
+ format='%(asctime)s %(levelname)s [%(name)s] %(message)s',
+ datefmt='%Y-%m-%d %H:%M:%S',
+ )
+