mirror of
https://gitlab.com/kupfer/kupferbootstrap.git
synced 2025-02-22 21:25:43 -05:00
logger.setup_logging(): add log_setup
parameter to disable log output from setup
This commit is contained in:
parent
66ac56d715
commit
0d4d83f0ed
1 changed files with 3 additions and 2 deletions
|
@ -4,7 +4,7 @@ import logging
|
|||
import sys
|
||||
|
||||
|
||||
def setup_logging(verbose: bool):
|
||||
def setup_logging(verbose: bool, log_setup: bool = True):
|
||||
level_colors = coloredlogs.DEFAULT_LEVEL_STYLES | {'info': {'color': 'magenta', 'bright': True}, 'debug': {'color': 'blue', 'bright': True}}
|
||||
field_colors = coloredlogs.DEFAULT_FIELD_STYLES | {'asctime': {'color': 'white', 'faint': True}}
|
||||
level = logging.DEBUG if verbose else logging.INFO
|
||||
|
@ -16,7 +16,8 @@ def setup_logging(verbose: bool):
|
|||
level_styles=level_colors,
|
||||
field_styles=field_colors,
|
||||
)
|
||||
logging.debug('Logging set up.')
|
||||
if log_setup:
|
||||
logging.debug('Logging set up.')
|
||||
|
||||
|
||||
verbose_option = click.option(
|
||||
|
|
Loading…
Add table
Reference in a new issue