mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
repo: get default logger level from logger
This commit is contained in:
+1
-1
@@ -179,7 +179,7 @@ class Config(object): # pylint: disable=too-many-instance-attributes
|
|||||||
SECTION_CORE_STORAGEPATH = "storagepath"
|
SECTION_CORE_STORAGEPATH = "storagepath"
|
||||||
|
|
||||||
SECTION_CORE_SCHEMA = {
|
SECTION_CORE_SCHEMA = {
|
||||||
Optional(SECTION_CORE_LOGLEVEL, default="info"): And(
|
Optional(SECTION_CORE_LOGLEVEL): And(
|
||||||
str, Use(str.lower), SECTION_CORE_LOGLEVEL_SCHEMA
|
str, Use(str.lower), SECTION_CORE_LOGLEVEL_SCHEMA
|
||||||
),
|
),
|
||||||
Optional(SECTION_CORE_REMOTE, default=""): And(str, Use(str.lower)),
|
Optional(SECTION_CORE_REMOTE, default=""): And(str, Use(str.lower)),
|
||||||
|
|||||||
@@ -68,11 +68,9 @@ class Repo(object):
|
|||||||
|
|
||||||
core = self.config.config[Config.SECTION_CORE]
|
core = self.config.config[Config.SECTION_CORE]
|
||||||
|
|
||||||
logger.setLevel(
|
level = core.get(Config.SECTION_CORE_LOGLEVEL)
|
||||||
logging.getLevelName(
|
if level:
|
||||||
core.get(Config.SECTION_CORE_LOGLEVEL, "info").upper()
|
logger.setLevel(level.upper())
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
self.cache = Cache(self)
|
self.cache = Cache(self)
|
||||||
self.cloud = DataCloud(self, config=self.config.config)
|
self.cloud = DataCloud(self, config=self.config.config)
|
||||||
|
|||||||
@@ -64,3 +64,10 @@ class TestInitNoSCM(TestDir):
|
|||||||
self.assertEqual(ret, 0)
|
self.assertEqual(ret, 0)
|
||||||
|
|
||||||
self._test_init()
|
self._test_init()
|
||||||
|
|
||||||
|
|
||||||
|
def test_init_quiet_should_not_display_welcome_screen(git, caplog):
|
||||||
|
ret = main(["init", "--quiet"])
|
||||||
|
|
||||||
|
assert 0 == ret
|
||||||
|
assert "" == caplog.text
|
||||||
|
|||||||
Reference in New Issue
Block a user