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:
FUJITA Tomonori 2014-05-24 10:46:55 +09:00
parent 46305c74be
commit fdb2d2b7db
2 changed files with 7 additions and 1 deletions

View File

@ -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([

View File

@ -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'.