~avishai-ish-shalom/cloud-init/chef-refactor

« back to all changes in this revision

Viewing changes to cloudinit/log.py

  • Committer: Scott Moser
  • Date: 2013-04-17 16:42:55 UTC
  • Revision ID: smoser@brickies.net-20130417164255-x0fctna5cseyxcsc
add debug output to ccfg-merge-debug

Exeptions were being swallowed completely and no way to even see them
other than log.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
DEF_CON_FORMAT = '%(asctime)s - %(filename)s[%(levelname)s]: %(message)s'
45
45
 
46
46
 
47
 
def setupBasicLogging():
 
47
def setupBasicLogging(level=DEBUG):
48
48
    root = logging.getLogger()
49
49
    console = logging.StreamHandler(sys.stderr)
50
50
    console.setFormatter(logging.Formatter(DEF_CON_FORMAT))
51
 
    console.setLevel(DEBUG)
 
51
    console.setLevel(level)
52
52
    root.addHandler(console)
53
 
    root.setLevel(DEBUG)
 
53
    root.setLevel(level)
54
54
 
55
55
 
56
56
def flushLoggers(root):