#!/usr/bin/python2
# -*- coding: utf-8 -*-
#
# example and test for standard logging

import argparse
import perfact.loggingtools

if __name__ == '__main__':
    parser = argparse.ArgumentParser(description='Show standard logging')

    parser.add_argument(
                    '--custom',
                    '-c',
                    type=int,
                    default=42,
                    help='Custom argument just to have one (defaults to 42)')
    perfact.loggingtools.addArgs(parser, name='example')
    args = parser.parse_args()
    custom = str(args.custom)
    logger = perfact.loggingtools.createLogger(args=args, name='example')
    print('Logging messages on every level')
    logger.debug(custom)
    logger.info(custom)
    logger.warn(custom)
    logger.error(custom)
    logger.fatal(custom)
    print('Done')
