Пример #1
0
 def emit(self, record):
     print("{} {} {}".format(record.msg[0], record.msg[2], record.msg[1]))
     stdout.flush()
     self.logsfile.write("{} {} {}\n".format(record.msg[0], record.msg[2],
                                             record.msg[1]))
     self.logsfile.flush()
     add_item(defaultdb["dbname"], defaultdb["alllogscoll"], {
         'time': record.msg[0],
         'message': record.msg[1]
     })
Пример #2
0
def setup_task_logger(task):
    log_string("Setting up task {} logger".format(task), "Yellow")
    add_item(defaultdb["dbname"], defaultdb["taskdblogscoll"], {
        "task": task,
        "logs": []
    })
    dynamic.handlers.clear()
    dynamic.setLevel(DEBUG)
    dynamic.addHandler(TaskHandler(task))
    dynamic.disabled = False
Пример #3
0
def setup_task_logger(task):
    '''
    setup the dynamic logger for the task
    '''
    log_string("Setting up task {} logger".format(task), "Yellow")
    add_item(defaultdb["dbname"], defaultdb["taskdblogscoll"], {
        "task": task,
        "logs": []
    })
    DYNAMIC.handlers.clear()
    DYNAMIC.setLevel(DEBUG)
    DYNAMIC.addHandler(TaskHandler(task))
    DYNAMIC.disabled = False