Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

btrz-logger

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

btrz-logger - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

package.json
{
"name": "btrz-logger",
"version": "1.0.3",
"version": "1.0.4",
"description": "A multi-transport logger",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,2 +8,3 @@ "use strict";

constructor(options) {
options.levels = {debug: 0, info: 1, error: 2, fatal: 3};
this.logger = logentries.logger(options);

@@ -20,3 +21,3 @@ }

fatal(tokens) {
this.error(tokens);
this.logger.log("error", tokens);
}

@@ -23,0 +24,0 @@

@@ -33,6 +33,20 @@ "use strict";

function buildMessage(level, msg, args, options) {
if (!Array.isArray(args)) {
args = [args];
let _msg = msg,
_args = args;
if (!_.isString(msg) && _.isString(args)) {
_args = msg;
_msg = args;
}
let serialized = serialize([], args),
if (!_.isString(msg) && !_.isString(args)) {
_args = [msg, args];
_msg = "";
}
if (!Array.isArray(_args)) {
_args = [_args];
}
let serialized = serialize([], _args),
dateParts = getDateParts(),

@@ -43,3 +57,3 @@ tokens = {

level: level,
message: msg,
message: _msg,
serverId: options && options.serverId ? options.serverId : "",

@@ -46,0 +60,0 @@ data: serialized.length > 0 ? serialized : ""

"use strict";
describe("console", function () {
let logger;
beforeEach(function () {
let Logger = require("../index").Logger,
ConsoleLogger = require("../index").ConsoleLogger,
LogEntriesLogger = require("../index").LogEntriesLogger,
logger = new Logger();
LogEntriesLogger = require("../index").LogEntriesLogger;
logger = new Logger();
logger.addLogger(new ConsoleLogger());

@@ -15,10 +17,7 @@ logger.addLogger(new LogEntriesLogger({token: "fake-token-here"}));

it("should log to console", function () {
// logger.debug("Hello log", new Error("err"));
// logger.info("Hello info", new Error("err"));
// logger.error("Hello error", new Error("err"));
// logger.fatal("Hello fatal", new Error("err"));
// logger.debug("Hello debug 2", {d: new Date(), some: "info", and: new Error("err")});
// logger.log("info", "some message");
// logger.info("info", {info: "some"});
// logger.error({info: "some"}, "some");
// logger.error({info: "some"}, {tokens: "token"});
// logger.error({info: "some"}, [{tokens: "token"}, [{second: "two"}]]);
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc