summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2006-10-10 15:19:17 +0000
committerNarayan Desai <desai@mcs.anl.gov>2006-10-10 15:19:17 +0000
commit11636a6e5ad02928b150676be21f090795374153 (patch)
treef815584862dd6a8287e8742f40aeada2401068e4
parent64666f99093de2bbe853e33162722ef2539a0e25 (diff)
downloadbcfg2-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
-rwxr-xr-xsrc/sbin/bcfg2-server13
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: