Project

General

Profile

« Previous | Next » 

Revision 2490

bin/map: Logging: log(): Remove extra debug info from DB query messages and format level 1.5 (summary) messages as Redmine list items

View differences:

bin/map
113 113
    def log(msg, level=1):
114 114
        '''Higher level -> more verbose'''
115 115
        if level <= verbosity:
116
            if level > 1: msg = '['+str(level)+'] '+msg # include level in msg
116
            if verbosity <= 2:
117
                if level == 1.5: msg = '# '+msg # msg is Redmine list item
118
                elif msg.startswith('DB query:'): # remove extra debug info
119
                    first_line, nl, msg = msg.partition('\n')
120
            elif level > 1: msg = '['+str(level)+'] '+msg # include level in msg
121
            
117 122
            sys.stderr.write(msg.rstrip('\n')+'\n')
118 123
    if debug: log_debug = lambda msg, level=2: log(msg, level)
119 124
    else: log_debug = sql.log_debug_none

Also available in: Unified diff