- fixed unwanted behaviour with default log severity in SConstruct #937

This commit is contained in:
kunitoki 2012-05-24 00:02:43 +02:00
parent f76c6ee25f
commit 0e5dcbd810

View file

@ -1416,18 +1416,18 @@ if not preconfigured:
ndebug_flags = '-DNDEBUG'
# Enable logging in debug mode (always) and release mode (when specified)
if env['DEFAULT_LOG_SEVERITY']:
severities = ['info', 'debug', 'warn', 'error', 'fatal', 'none']
if env['DEFAULT_LOG_SEVERITY']:
if env['DEFAULT_LOG_SEVERITY'] not in severities:
color_print(1,"Cannot set default logger severity to '%s', available options are 'info', 'debug', 'warn', 'error', 'fatal', 'none'." % env['DEFAULT_LOG_SEVERITY'])
severities_list = ', '.join(["'%s'" % s for s in severities])
color_print(1,"Cannot set default logger severity to '%s', available options are %s." % (env['DEFAULT_LOG_SEVERITY'], severities_list))
Exit(1)
else:
log_severity = severities.index(env['DEFAULT_LOG_SEVERITY'])
else:
if env['DEBUG']:
log_severity = 1 # debug
else:
log_severity = 3 # error
severities_list = ', '.join(["'%s'" % s for s in severities])
color_print(1,"No logger severity specified, available options are %s." % severities_list)
Exit(1)
log_enabled = ' -DMAPNIK_LOG -DMAPNIK_DEFAULT_LOG_SEVERITY=%d' % log_severity