How to use the tracer.setLevel function in tracer

To help you get started, we’ve selected a few tracer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github baryon / tracer / example / setLevel.js View on Github external
console.log('setLevel(debug)')
tracer.setLevel('debug');
hello();
bb.hi()


console.log('close all')
tracer.close();

hello();
bb.hi()


console.log('setLevel(0) log')
tracer.setLevel(0);
hello();
bb.hi()
github baryon / tracer / example / setLevel.js View on Github external
function hello() {
	logger.log('hello');
	logger.trace('hello', 'world');
	logger.debug('hello %s', 'world', 123);
	logger.warn('hello %s', 'world', 123);
	logger.error('hello %s', 'world', 123);
}

console.log('ALL default Level')
hello();
bb.hi()


console.log('setLevel(debug)')
tracer.setLevel('debug');
hello();
bb.hi()


console.log('close all')
tracer.close();

hello();
bb.hi()


console.log('setLevel(0) log')
tracer.setLevel(0);
hello();
bb.hi()
github pascalw / dashbling / packages / core / src / lib / logger.ts View on Github external
logger.setLevel = (level: Level) => {
  tracer.setLevel(level);
};
github pascalw / dashbling / lib / logger.js View on Github external
module.exports.setLevel = level => {
  tracer.setLevel(level);
};
github AschPlatform / asch / app.js View on Github external
daemon({ cwd: process.cwd() })
    fs.writeFileSync(pidFile, process.pid, 'utf8')
  }

  let logger
  if (program.daemon) {
    logger = tracer.dailyfile({
      root: path.join(baseDir, 'logs'),
      maxLogFiles: 10,
      allLogsFileName: 'debug',
      dateformat: 'yyyy-mm-dd HH:MM:ss.L'
    })
  } else {
    logger = tracer.colorConsole({ dateformat: 'yyyy-mm-dd HH:MM:ss.L' })
  }
  tracer.setLevel(appConfig.logLevel)

  const options = {
    appConfig,
    genesisblock,
    logger,
    pidFile,
  }
  const app = new Application(options)
  app.run()
}

tracer

A powerful and customizable logging library for node.js. support color console with timestamp, line number, method name, file name and call stack. you can set transport to file, stream, database(ex: mongodb and clouddb, simpledb). keywords: log, logger, t

MIT
Latest version published 1 year ago

Package Health Score

57 / 100
Full package analysis