test.py 469 Bytes
Newer Older
GI's avatar
GI committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#! /usr/bin/python
import os, sys
pwd = os.path.dirname(os.path.realpath(__file__))
sys.path.insert( 1, os.path.join( pwd, 'ext' ) )

import logging, coloredlogs


logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
logger.addHandler(logging.StreamHandler())

logger.info('Before installing colored logger')

coloredlogs.install( logger=logger, fmt='%(message)s')

#logger.removeHandler(logger.handlers[0])
logger.warn('After installing colored logger')