def test_configure_debug_log_bad_file(config, context): config['DEBUGLOG'] = '/nopenopenope' logs.configure(config) context.assert_log( msg='could not', name='talisker.logs', level='INFO', extra={'path': '/nopenopenope'}, )
def test_configure_debug_log(config, context): tmp = tempfile.mkdtemp() logfile = os.path.join(tmp, 'log') config['DEBUGLOG'] = logfile logs.configure(config) context.assert_log( msg='enabling', name='talisker.logs', level='INFO', extra={'path': logfile}, )