def test_simple_logger_log_func(self): def log_func(typ, filename, n, msg): print('typ=%r filename=%r n=%r msg=%r' % (typ, filename, n, msg)) assert typ == 'INFO', '%r' % msg assert msg == 'info_log_func', '%r' % msg log = SimpleLogger(level='info', log_func=log_func) log.info('info_log_func')
def test_simple_logger(self): log = SimpleLogger(level='critical') log.info('info') log.warning('warning') log.error('error') log.debug('debug') log.exception('exception') out = log.critical('critical') assert out is None