Creates the logging
181498
@Override
	public void validateSetup(Server server, Query query) throws ValidationException {
		// Check if we've already created a logger for this file. If so, use it.
		Logger logger;
		if (loggers.containsKey(outputFile)) {
			logger = getLogger(outputFile);
		}else{
			// need to create a logger
			try {
				logger = buildLogger(outputFile);
				loggers.put(outputFile, logger);
			} catch (IOException e) {
				throw new ValidationException("Failed to setup logback", query, e);
			}
		}
		logwriter = new LogWriter(logger,delimiter);
	}
528227
def initLogger():
    '''
    
    '''
    global logger
    logger = logging.getLogger('root')
    logger.setLevel(logging.DEBUG)
    ch = logging.StreamHandler(sys.stdout)
    ch.setLevel(logging.INFO)
    formatter = logging.Formatter("[%(asctime)s] %(levelname)s: %(message)s", "%Y-%m-%d %H:%M:%S")
    ch.setFormatter(formatter)
    logger.addHandler(ch)
169988
def _create_logger_(name):
    """"""
    logger = logging.getLogger(name)
    handler = logging.StreamHandler()
    handler.setFormatter(logging.Formatter('%(levelname)s %(message)s'))
    logger.addHandler(handler)
    logger.setLevel(logging.INFO)
    return logger
1140494
def init_logs(args, tool="NanoPlot"):
    """"""
    start_time = dt.fromtimestamp(time()).strftime('%Y%m%d_%H%M')
    logname = os.path.join(args.outdir, args.prefix + tool + "_" + start_time + ".log")
    handlers = [logging.FileHandler(logname)]
    if args.verbose:
        handlers.append(logging.StreamHandler())
    logging.basicConfig(
        format='%(asctime)s %(message)s',
        handlers=handlers,
        level=logging.INFO)
    logging.info('{} {} started with arguments {}'.format(tool, __version__, args))
    logging.info('Python version is: {}'.format(sys.version.replace('\n', ' ')))
    return logname
569194
function Log(writer, level, prefix) {
    if (!(this instanceof Log)) return new Log(writer, level, prefix);
    this.writer = writer || process.stdout;
    this.prefix = prefix || '';
    this.level = (typeof level === 'undefined') ? LEVEL.ALL : level;
}
671828
def setup_script_logging():
    
    handlers = [logbook.NullHandler()]
    format_str = ("[{record.time:%Y-%m-%dT%H:%MZ}] "
                  "{record.level_name}: {record.message}")

    handler = logbook.StreamHandler(sys.stderr, format_string=format_str,
                                    level="DEBUG")
    handler.push_thread()
    return handler
221004
def setup_logging():
    

    # Console formatter, mention name
    cfmt = logging.Formatter(('%(name)s - %(levelname)s - %(message)s'))

    # File formatter, mention time
    ffmt = logging.Formatter(('%(asctime)s - %(levelname)s - %(message)s'))

    # Console handler
    ch = logging.StreamHandler()
    ch.setLevel(logging.INFO)
    ch.setFormatter(cfmt)

    # File handler
    fh = logging.handlers.RotatingFileHandler('montblanc.log',
        maxBytes=10*1024*1024, backupCount=10)
    fh.setLevel(logging.INFO)
    fh.setFormatter(ffmt)

    # Create the logger,
    # adding the console and file handler
    mb_logger = logging.getLogger('montblanc')
    mb_logger.handlers = []
    mb_logger.setLevel(logging.DEBUG)
    mb_logger.addHandler(ch)
    mb_logger.addHandler(fh)

    # Set up the concurrent.futures logger
    cf_logger = logging.getLogger('concurrent.futures')
    cf_logger.setLevel(logging.DEBUG)
    cf_logger.addHandler(ch)
    cf_logger.addHandler(fh)

    return mb_logger
477963
def logs(self):
        """"""
        url = self._url + "/logs"
        return _log(url=url,
                    securityHandler=self._securityHandler,
                    proxy_url=self._proxy_url,
                    proxy_port=self._proxy_port)
84193
def init_logging(debug=False, logfile=None):
    """"""
    loglevel = logging.DEBUG if debug else logging.INFO
    logformat = '%(asctime)s %(name)s: %(levelname)s: %(message)s'
    formatter = logging.Formatter(logformat)
    stderr = logging.StreamHandler()
    stderr.setFormatter(formatter)

    root = logging.getLogger()
    root.setLevel(loglevel)
    root.handlers = [stderr]

    if logfile:
        fhandler = logging.FileHandler(logfile)
        fhandler.setFormatter(formatter)
        root.addHandler(fhandler)
1330133
@Override
    protected LogHandler createLogHandler(ServletConfig pServletConfig, boolean pDebug) {
        // If there is a bundle context available, set up a tracker for tracking the logging
        // service
        BundleContext ctx = getBundleContext(pServletConfig);
        if (ctx != null) {
            // Track logging service
            logTracker = new ServiceTracker(ctx, LogService.class.getName(), null);
            logTracker.open();
            return new ActivatorLogHandler(logTracker,pDebug);
        } else {
            // Use default log handler
            return super.createLogHandler(pServletConfig, pDebug);
        }
    }
977367
function createLogger(instance){

    // generator
    function log(level){
        return function(...args){

            // logging backend available ?
            if (_loggingBackends.length > 0){

                // trigger backends
                _loggingBackends.forEach(function(backend){
                    backend.apply(backend, [instance, level, args]);
                });

            // use default backend
            }else{
                _defaultBackend.apply(_defaultBackend, [instance, level, args]);
            }
        }
    }
    
    return exposeAPI(log);
}
1225029
def initialize_logging(args):
    """"""
    log_handler = logging.StreamHandler()
    log_formatter = logging.Formatter(
        "%(levelname)s %(asctime)s %(name)s:%(lineno)04d - %(message)s")
    log_handler.setFormatter(log_formatter)

    root_logger = logging.getLogger()
    root_logger.addHandler(log_handler)
    root_logger.setLevel(getattr(logging, args.loglevel))
604175
def init_logging():
    """"""
    fmt = '%(asctime)s.%(msecs)03d | %(name)-60s | %(levelname)-7s ' \
          '| %(message)s'
    logging.basicConfig(format=fmt, datefmt='%H:%M:%S', level=logging.DEBUG)
639469
def log(self, *args):
        '''
        
        '''
        if len(args):
            self._log = args[0]
        else:
            return self._log
299110
protected void setupLogging() {
		super.setupLogging();

		final Logger rootLogger = LogManager.getRootLogger();
		rootLogger.addAppender(new NullAppender());
		final Logger logger = LogManager.getLogger("org.jvnet.hyperjaxb3");

		final Log log = getLog();
		logger.addAppender(new Appender(getLog(), new PatternLayout(
				"%m%n        %c%n")));

		if (this.getDebug()) {
			log.debug("Logger level set to [debug].");
			logger.setLevel(Level.DEBUG);
		} else if (this.getVerbose())
			logger.setLevel(Level.INFO);
		else if (log.isWarnEnabled())
			logger.setLevel(Level.WARN);
		else
			logger.setLevel(Level.ERROR);
	}
967776
def create_logger(name):
    
    logging.config.dictConfig({
        'version': 1,
        'disable_existing_loggers': False,
        'formatters': {
            'simple': {
                'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s'
            },
            'detailed': {
                'format': '%(asctime)s %(module)-17s line:%(lineno)-4d '
                          '%(levelname)-8s %(message)s'
            },
            'email': {
                'format': 'Timestamp: %(asctime)s\nModule: %(module)s\n'
                          'Line: %(lineno)d\nMessage: %(message)s'
            },
        },
        'handlers': {
            # 'stream': {
            #     'level': 'DEBUG',
            #     'class': 'logging.StreamHandler',
            #     "formatter": "simple"
            # },
            "file": {
                "level": "DEBUG",
                "formatter": "simple",
                "class": "logging.handlers.RotatingFileHandler",
                "filename": "debug.log",
                'mode': 'a',
                'maxBytes': 30000,
                'backupCount': 0
            }
        },
        'loggers': {
            '': {
                # "handlers": ["stream", "file"],
                "handlers": ["file"],
                "level": "DEBUG",
                'propagate': True
            }
        }
    })
    return logging.getLogger(name)
887417
def setup_logging(level):
    
    format = "[%(asctime)s] %(levelname)s:%(name)s:%(message)s"
    logging.basicConfig(
        level=level, stream=sys.stdout, format=format, datefmt="%Y-%m-%d %H:%M:%S"
    )