diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-09 17:49:33 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-09 17:49:33 +0000 |
commit | edfae9e78af23bdd6161c55c7ec88533de8925f8 (patch) | |
tree | 2659368f56fc6ba8616c53c6c9724140ced98859 /modules/logging_config.py | |
parent | c7b9394daf9efc5da8e56007199c3fc3e7439f92 (diff) | |
download | stable-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.py | 16 |
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',
+ )
+
|