def test_win32_logger(self):
        from logbook import NTEventLogHandler, Logger

        logger = Logger('MyLogger')
        handler = NTEventLogHandler('My Application')

        with handler.applicationbound():
            logger.error('Testing')
Example #2
0
def create_syshandler(*_, **__):
    """
    Get yourself the correct system log handler.

    You shouldn't need to use this directly.

    :param _: Unused, ignored
    :param __: Unused, ignored
    :return: Logbook logger for logging to this OS's system logs
    """

    if os.name == 'nt':
        return NTEventLogHandler("Ultros")
    return SyslogHandler("Ultros")
Example #3
0
from logbook import NTEventLogHandler, Logger

logger = Logger('MyLogger')
handler = NTEventLogHandler('My Application')

with handler.applicationbound():
    logger.error('Testing')