How to use the bunyan.TRACE function in bunyan

To help you get started, we’ve selected a few bunyan 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 joyent / manatee / lib / pg_dump / mmkdir.js View on Github external
case 'h':
                        opts.host = option.optarg;
                        break;

                case 'k':
                        opts.keyPath = option.optarg;
                        break;

                case 'u':
                        opts.url = url.parse(option.optarg).href;
                        break;

                case 'v':
                        // Allows us to set -vvv -> this little hackery
                        // just ensures that we're never < TRACE
                        LOG.level(Math.max(bunyan.TRACE, (LOG.level() - 10)));
                        if (LOG.level() <= bunyan.DEBUG)
                                LOG = LOG.child({src: true});
                        break;

                default:
                        process.exit(1);
                        break;
                }

        }

        if (!opts.url && !process.env.MANTA_URL)
                usage('url is a required argument');

        if (!opts.user && !process.env.MANTA_USER)
                usage('account is a required argument');
github joyent / manatee / lib / pg_dump / mput.js View on Github external
case 'h':
                        opts.host = option.optarg;
                        break;

                case 'k':
                        opts.keyPath = option.optarg;
                        break;

                case 'u':
                        opts.url = url.parse(option.optarg).href;
                        break;

                case 'v':
                        // Allows us to set -vvv -> this little hackery
                        // just ensures that we're never < TRACE
                        LOG.level(Math.max(bunyan.TRACE, (LOG.level() - 10)));
                        if (LOG.level() <= bunyan.DEBUG)
                                LOG = LOG.child({src: true});
                        break;

                default:
                        process.exit(1);
                        break;
                }

        }

        if (!opts.url && !process.env.MANTA_URL)
                usage('url is a required argument');

        if (!opts.user && !process.env.MANTA_USER)
                usage('account is a required argument');
github jsdelivr / data.jsdelivr.com / src / lib / logger / index.js View on Github external
if (record.level >= bunyan.ERROR) {
			global.OPBEAT_CLIENT.setExtraContext(_.assign({
				level: OpbeatStream.levels[record.level],
			}, _.omit(record, [ 'err', 'level', 'name', 'req', 'v' ])));

			global.OPBEAT_CLIENT.captureError(record.err);
		} else {
			global.OPBEAT_CLIENT.setExtraContext(_.assign({
				level: OpbeatStream.levels[record.level],
			}, _.omit(record, [ 'level', 'name', 'v' ])));
		}
	}
}

OpbeatStream.levels = {
	[bunyan.TRACE]: 'debug',
	[bunyan.DEBUG]: 'debug',
	[bunyan.INFO]: 'info',
	[bunyan.WARN]: 'warning',
	[bunyan.ERROR]: 'error',
	[bunyan.FATAL]: 'fatal',
};

module.exports = bunyan.createLogger({
	name: 'app-log',
	streams: process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test' ? [
		{ level: bunyan.TRACE, type: 'raw', stream: prettyStream },
	] : [
		{ level: bunyan.TRACE, type: 'raw', stream: new FileStream(path.join(loggerConfig.path, process.pid + '.log')) },
		// { level: bunyan.TRACE, type: 'raw', stream: new OpbeatStream() },
	],
	serializers: _.defaults({
github joyent / manatee / backupserver.js View on Github external
function parseOptions() {
    var option;
    var opts = {};
    var parser = new getopt.BasicParser('vf:(file)', process.argv);

    while ((option = parser.getopt()) !== undefined) {
        switch (option.option) {
            case 'f':
                opts.file = option.optarg;
                break;

            case 'v':
                // Allows us to set -vvv -> this little hackery
                // just ensures that we're never < TRACE
                LOG_LEVEL_OVERRIDE = true;
                LOG.level(Math.max(bunyan.TRACE, (LOG.level() - 10)));
                if (LOG.level() <= bunyan.DEBUG)
                    LOG = LOG.child({src: true});
                break;

            default:
                LOG.fatal('Unsupported option: ', option.option);
                process.abort();
                break;
        }
    }

    return (opts);
}
github restify / node-restify / examples / todoapp / main.js View on Github external
case 'h':
                usage();
                break;

            case 'p':
                opts.port = parseInt(option.optarg, 10);
                break;

            case 'u':
                opts.user = option.optarg;
                break;

            case 'v':
                // Allows us to set -vvv -> this little hackery
                // just ensures that we're never < TRACE
                LOG.level(Math.max(bunyan.TRACE, LOG.level() - 10));

                if (LOG.level() <= bunyan.DEBUG) {
                    LOG = LOG.child({ src: true });
                }
                break;

            case 'z':
                opts.password = option.optarg;
                break;

            default:
                usage('invalid option: ' + option.option);
                break;
        }
    }
github RethinkRobotics-opensource / rosnodejs / src / utils / log / RosLogStream.js View on Github external
_getRosLogLevel(bunyanLogLevel) {
    // ROS log levels defined in rosgraph_msgs/Log
    // bunyan trace and debug levels will both map to ROS debug
    if (bunyanLogLevel === bunyan.TRACE) {
      return RosgraphLogMsg.Constants.DEBUG;
    }
    // else
    return RosgraphLogMsg.Constants[bunyan.nameFromLevel[bunyanLogLevel].toUpperCase()];
  }
github eclipse-theia / theia / packages / bunyan / src / node / bunyan-logger-server.ts View on Github external
protected toBunyanLevel(logLevel: number): number {
        switch (logLevel) {
            case LogLevel.FATAL:
                return bunyan.FATAL;
            case LogLevel.ERROR:
                return bunyan.ERROR;
            case LogLevel.WARN:
                return bunyan.WARN;
            case LogLevel.INFO:
                return bunyan.INFO;
            case LogLevel.DEBUG:
                return bunyan.DEBUG;
            case LogLevel.TRACE:
                return bunyan.TRACE;
            default:
                return bunyan.INFO;
        }
    }
github imodeljs / imodeljs / core / logger-config / src / FluentdLoggerStream.ts View on Github external
private mapLevelToString(level: any): any {
    let response: string;
    switch (level) {
      case bunyan.TRACE: {
        response = "Trace";
        break;
      }
      case bunyan.DEBUG: {
        response = "Debug";
        break;
      }
      case bunyan.INFO: {
        response = "Information";
        break;
      }
      case bunyan.WARN: {
        response = "Warning";
        break;
      }
      case bunyan.ERROR: {