- fixed unwanted behaviour with default log severity in SConstruct #937
This commit is contained in:
parent
f76c6ee25f
commit
0e5dcbd810
1 changed files with 138 additions and 138 deletions
12
SConstruct
12
SConstruct
|
@ -1416,18 +1416,18 @@ if not preconfigured:
|
|||
ndebug_flags = '-DNDEBUG'
|
||||
|
||||
# Enable logging in debug mode (always) and release mode (when specified)
|
||||
severities = ['info', 'debug', 'warn', 'error', 'fatal', 'none']
|
||||
if env['DEFAULT_LOG_SEVERITY']:
|
||||
severities = ['info', 'debug', 'warn', 'error', 'fatal', 'none']
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue