mirror of
https://github.com/bigchaindb/bigchaindb.git
synced 2024-10-13 13:34:05 +00:00
Configure logging in bigchaindb_configure
decorator
This commit is contained in:
parent
c0498abed3
commit
d688e695e6
@ -25,7 +25,6 @@ from bigchaindb.commands.messages import (
|
||||
RETHINKDB_STARTUP_ERROR,
|
||||
)
|
||||
from bigchaindb.commands.utils import configure_bigchaindb, input_on_stderr
|
||||
from bigchaindb.log.setup import setup_logging
|
||||
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
@ -16,6 +16,7 @@ import bigchaindb
|
||||
import bigchaindb.config_utils
|
||||
from bigchaindb import backend
|
||||
from bigchaindb.common.exceptions import StartupError
|
||||
from bigchaindb.log.setup import setup_logging
|
||||
from bigchaindb.version import __version__
|
||||
|
||||
|
||||
@ -23,6 +24,12 @@ def configure_bigchaindb(command):
|
||||
@functools.wraps(command)
|
||||
def configure(args):
|
||||
bigchaindb.config_utils.autoconfigure(filename=args.config, force=True)
|
||||
|
||||
logging_config = bigchaindb.config['logging'] or {}
|
||||
if 'log_level' in args and args.log_level:
|
||||
logging_config['level'] = args.log_level
|
||||
setup_logging(logging_config)
|
||||
|
||||
command(args)
|
||||
|
||||
return configure
|
||||
|
Loading…
x
Reference in New Issue
Block a user