logging: set default level to warning; add flag for debug mode
This commit is contained in:
parent
3c97e45f36
commit
305d42b9a9
|
@ -6,8 +6,4 @@ container creations, support various network configurations, uses apt-cacher-ng
|
|||
if available, and more (note: for zone network setup, please systemctl enable
|
||||
systemd-networkd)"""
|
||||
|
||||
import logging
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
__version__ = 0.6
|
||||
|
|
|
@ -3,9 +3,9 @@ import os
|
|||
import sys
|
||||
import argparse
|
||||
import dspawn
|
||||
from dspawn import logger
|
||||
import logging
|
||||
from dspawn.container import Machine
|
||||
|
||||
from dspawn.container import logger
|
||||
|
||||
machinectl_actions = ['list', 'list-images', 'start', 'stop', 'show',
|
||||
'shell', 'remove', 'login', 'enable', 'disable',
|
||||
|
@ -37,11 +37,17 @@ def main():
|
|||
parser.add_argument('-p', '--privateoff',
|
||||
action='store_true',
|
||||
help='turn off PrivateUsers mapping'),
|
||||
parser.add_argument('-v', '--verbose',
|
||||
action='store_true',
|
||||
help='display debug messages'),
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.verbose:
|
||||
logger.setLevel(logging.DEBUG)
|
||||
|
||||
if args.address and args.mode == 'private':
|
||||
logger.info('Notice: auto-selecting zone network mode, required with static address')
|
||||
logger.info('auto-selecting zone network mode, required with static address')
|
||||
args.mode = 'zone'
|
||||
|
||||
if args.action == 'create' or args.action == 'config':
|
||||
|
|
|
@ -2,9 +2,12 @@
|
|||
import os
|
||||
import glob
|
||||
import apt
|
||||
from dspawn import logger
|
||||
from dspawn.netconf import MachineConfig
|
||||
|
||||
import logging
|
||||
logging.basicConfig(level=logging.WARNING)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
defaults = {
|
||||
'arch': os.uname()[4],
|
||||
|
|
Loading…
Reference in New Issue