Did I find the right examples for you? yes no

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
Initialize the app's logger

        def init_logging(loglevel, printout=True, logfile=None):
    """
    Initialize the app's logger
    """
    rootlogger = logging.getLogger('gestus_client')
    rootlogger.setLevel(getattr(logging, loglevel))
    
    if not printout and not logfile:
        from StringIO import StringIO
        dummystream = StringIO()
        rootlogger.addHandler(logging.StreamHandler(dummystream))
    else:
        if printout:
            rootlogger.addHandler(ColorizingStreamHandler())
        if logfile:
            rootlogger.addHandler(logging.FileHandler(logfile))
    
    rootlogger.debug("Set logger level to: %s", loglevel)
    return rootlogger
        


src/g/e/Gestus-client-0.0.5/gestus_client/cli.py   Gestus-client(Download)
    starttime = datetime.datetime.now()
    # Init, load and builds
    root_logger = logging_handler.init_logging(args.loglevel.upper(), logfile=args.logfile)
 
    # Open config file if exists
    starttime = datetime.datetime.now()
    # Init, load and builds
    root_logger = logging_handler.init_logging(args.loglevel.upper(), logfile=args.logfile)
 
    print "Hello world!"