mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-01-22 17:12:01 +01:00
apgw: add apgw-debug command line option
set the log level to debug. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
46305c74be
commit
fdb2d2b7db
@ -52,7 +52,8 @@ CONF.register_cli_opts([
|
||||
cfg.IntOpt('vrrp-rpc-port', default=50004,
|
||||
help='port for vrrp rpc interface'),
|
||||
cfg.BoolOpt('vrrp-use-vmac', default=False,
|
||||
help='use virtual mac')
|
||||
help='use virtual mac'),
|
||||
cfg.BoolOpt('apgw-debug', default=False, help='use debug level'),
|
||||
])
|
||||
|
||||
CONF.register_cli_opts([
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
from oslo.config import cfg
|
||||
import platform
|
||||
import datetime
|
||||
import json
|
||||
@ -10,6 +11,8 @@ APGW_KEYS = [
|
||||
'log_type',
|
||||
]
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
def convert_str_to_log_level(log_level):
|
||||
try:
|
||||
@ -102,6 +105,8 @@ def configure_logging(log, component_name):
|
||||
log_level = logging.getLevelName(log.level)
|
||||
if log_level == 'NOTSET':
|
||||
log_level = logging.INFO
|
||||
if CONF.apgw_debug:
|
||||
log_level = logging.DEBUG
|
||||
log.setLevel(log_level)
|
||||
|
||||
# we don't write to stdout unless the level is 'debug'.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user