1
0
mirror of https://github.com/samba-team/samba.git synced 2025-09-09 01:44:21 +03:00

netcmd: apply the new get_logger to cmds

This is an example of how to use the new logger.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joe Guo
2018-08-21 12:45:15 +12:00
committed by Douglas Bagnall
parent 0979d96006
commit 126a14b443
3 changed files with 7 additions and 48 deletions

View File

@@ -1104,13 +1104,7 @@ class cmd_cleanup_record(Command):
lp = sambaopts.get_loadparm()
creds = credopts.get_credentials(lp)
logger = self.get_logger()
if verbose:
logger.setLevel(logging.DEBUG)
elif quiet:
logger.setLevel(logging.WARNING)
else:
logger.setLevel(logging.INFO)
logger = self.get_logger(verbose=verbose, quiet=quiet)
samdb = SamDB(url="ldap://%s" % server,
session_info=system_session(),