mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
logging: show logs from dvc-objects
This commit is contained in:
committed by
skshetry
parent
37921d618d
commit
572b6dfca9
+2
-2
@@ -143,7 +143,7 @@ def main(argv=None): # noqa: C901
|
||||
from dvc._debug import debugtools
|
||||
from dvc.config import ConfigError
|
||||
from dvc.exceptions import DvcException, NotDvcRepoError
|
||||
from dvc.logger import disable_other_loggers
|
||||
from dvc.logger import disable_other_loggers, set_loggers_level
|
||||
|
||||
# NOTE: stderr/stdout may be closed if we are running from dvc.daemon.
|
||||
# On Linux we directly call cli.main after double forking and closing
|
||||
@@ -171,7 +171,7 @@ def main(argv=None): # noqa: C901
|
||||
level = logging.TRACE
|
||||
|
||||
if level is not None:
|
||||
logger.setLevel(level)
|
||||
set_loggers_level(level)
|
||||
|
||||
logger.trace(args)
|
||||
|
||||
|
||||
+16
-2
@@ -207,7 +207,12 @@ def disable_other_loggers():
|
||||
logger.disabled = True
|
||||
|
||||
|
||||
def setup(level=logging.INFO):
|
||||
def set_loggers_level(level: int = logging.INFO) -> None:
|
||||
for name in ["dvc", "dvc_objects"]:
|
||||
logging.getLogger(name).setLevel(level)
|
||||
|
||||
|
||||
def setup(level: int = logging.INFO) -> None:
|
||||
colorama.init()
|
||||
|
||||
if level >= logging.DEBUG:
|
||||
@@ -269,7 +274,16 @@ def setup(level=logging.INFO):
|
||||
"console_trace",
|
||||
"console_errors",
|
||||
],
|
||||
}
|
||||
},
|
||||
"dvc_objects": {
|
||||
"level": level,
|
||||
"handlers": [
|
||||
"console_info",
|
||||
"console_debug",
|
||||
"console_trace",
|
||||
"console_errors",
|
||||
],
|
||||
},
|
||||
},
|
||||
"disable_existing_loggers": False,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user