- 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' ndebug_flags = '-DNDEBUG'
# Enable logging in debug mode (always) and release mode (when specified) # Enable logging in debug mode (always) and release mode (when specified)
severities = ['info', 'debug', 'warn', 'error', 'fatal', 'none']
if env['DEFAULT_LOG_SEVERITY']: if env['DEFAULT_LOG_SEVERITY']:
severities = ['info', 'debug', 'warn', 'error', 'fatal', 'none']
if env['DEFAULT_LOG_SEVERITY'] not in severities: 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) Exit(1)
else: else:
log_severity = severities.index(env['DEFAULT_LOG_SEVERITY']) log_severity = severities.index(env['DEFAULT_LOG_SEVERITY'])
else: else:
if env['DEBUG']: severities_list = ', '.join(["'%s'" % s for s in severities])
log_severity = 1 # debug color_print(1,"No logger severity specified, available options are %s." % severities_list)
else: Exit(1)
log_severity = 3 # error
log_enabled = ' -DMAPNIK_LOG -DMAPNIK_DEFAULT_LOG_SEVERITY=%d' % log_severity log_enabled = ' -DMAPNIK_LOG -DMAPNIK_DEFAULT_LOG_SEVERITY=%d' % log_severity