diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2006-10-10 15:19:17 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2006-10-10 15:19:17 +0000 |
commit | 11636a6e5ad02928b150676be21f090795374153 (patch) | |
tree | f815584862dd6a8287e8742f40aeada2401068e4 /src/sbin | |
parent | 64666f99093de2bbe853e33162722ef2539a0e25 (diff) | |
download | bcfg2-11636a6e5ad02928b150676be21f090795374153.tar.gz bcfg2-11636a6e5ad02928b150676be21f090795374153.tar.bz2 bcfg2-11636a6e5ad02928b150676be21f090795374153.zip |
* Respect -v and -d for verbosity
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2426 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/sbin')
-rwxr-xr-x | src/sbin/bcfg2-server | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server index 8e845a7d4..7f5c42f1e 100755 --- a/src/sbin/bcfg2-server +++ b/src/sbin/bcfg2-server @@ -192,10 +192,6 @@ class Bcfg2Serv(Bcfg2.Server.Component.Component): return "<ok/>" if __name__ == '__main__': - if '-D' in sys.argv: - Bcfg2.Logging.setup_logging('bcfg2-server', to_console=False) - else: - Bcfg2.Logging.setup_logging('bcfg2-server') OPTINFO = { 'verbose': (('-v', False, 'enable verbose output'), @@ -211,6 +207,15 @@ if __name__ == '__main__': } SSETUP = Bcfg2.Options.OptionParser('bcfg2', OPTINFO).parse() + level = 20 + if self.setup['verbose']: + level = 10 + if self.setup['debug']: + level = 0 + if '-D' in sys.argv: + Bcfg2.Logging.setup_logging('bcfg2-server', to_console=False, level=level) + else: + Bcfg2.Logging.setup_logging('bcfg2-server', level=level) if SSETUP['daemon']: daemonize(SSETUP['daemon']) try: |