Ejemplo n.º 1
0
    def test_logging_levels(self):
        w = Wryte(name=str(uuid.uuid4()))

        w.event('Event')
        w.log('info', 'My Message')
        w.debug('Debug Message')
        w.info('Info Message')
        w.warning('Warning Message')
        w.warn('Warning Message')
        w.error('Error Message')
        w.critical('Critical Message')
Ejemplo n.º 2
0
 def test_set_level_from_log(self):
     w = Wryte(name=str(uuid.uuid4()))
     assert w.logger.getEffectiveLevel() == 20
     w.log('error', 'My Error', _set_level='debug')
     assert w.logger.getEffectiveLevel() == 10
Ejemplo n.º 3
0
 def test_set_level_from_log(self):
     w = Wryte(name=str(uuid.uuid4()))
     assert w.get_level() == logging.INFO
     w.log('error', 'My Error', _set_level='debug')
     assert w.get_level() == logging.DEBUG
Ejemplo n.º 4
0
 def test_log_bad_level(self):
     w = Wryte(name=str(uuid.uuid4()))
     w.log('booboo', 'My Error')
Ejemplo n.º 5
0
from wryte import Wryte

wryter = Wryte(name='Wryte', level='info')
wryter.info('Logging an error level message:')
wryter.log('error', 'w00t')

wryter.info('Logging an event:', w00t='d')
wryter.event('w00t')

wryter.info('Binding more dicts to the logger:')
wryter.bind({'bound1': 'value1'}, bound2='value2')
wryter.info('bind_test')

wryter.info('Unbinding keys:')
wryter.unbind('bound1')
wryter.critical('unbind_test')

wryter.error('w00t', _set_level='debug')

wryter.debug('test-kwargs', key1='value')
wryter.error('message', _set_level='info', x='y', a='b')
wryter.debug('test-kwargs', key1='value')
wryter.info('w00t', ['ttt'])