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

@geek/logger

Package Overview
Dependencies
Maintainers
2
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@geek/logger - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

31

Logger.js

@@ -101,4 +101,3 @@ 'use strict';

this[level_name] = async (message, params = {}) => {
params = getLogParams(message, params, level_name);
params = getLogLevelParams(level_name, message, params);
const current_namespace = params.namespace || this.namespace;

@@ -122,4 +121,5 @@ if (all_namespaces.get(current_namespace)) {

if (parent) {
this[level_name] = async params => {
params = getLogParams(params);
this[level_name] = async (message, params = {}) => {
// params = getLogParams(params);
params = getLogLevelParams(level_name, message, params);
const current_namespace = params.namespace || this.namespace;

@@ -147,3 +147,5 @@ if (all_namespaces.get(current_namespace)) {

params = getLogParams(message, params, level_name);
// params = getLogParams(message, params, level_name);
params = getLogLevelParams(level_name, message, params);
const current_namespace = params.namespace || this.namespace;

@@ -163,3 +165,3 @@ if (all_namespaces.get(current_namespace)) {

this.log = async (level, message, params = {}) => {
params = getLogLevelParams(params);
params = getLogLevelParams(level, message, params);
const current_namespace = params.namespace || this.namespace;

@@ -176,3 +178,3 @@ if (all_namespaces.get(current_namespace)) {

this.log = async (level, message, params = {}) => {
params = getLogLevelParams(params);
params = getLogLevelParams(level, message, params);

@@ -286,3 +288,3 @@ const current_namespace = params.namespace || this.namespace;

const getLogParams = (message = '', params = {}) => {
const getLogParams = (message, params = {}) => {

@@ -292,2 +294,3 @@ if (typeof message === 'object') {

params = checkForError(message);
params.message = params.error_message;
} else if (typeof message === 'string') {

@@ -307,2 +310,3 @@ if (typeof params !== 'object') {

return params;

@@ -313,5 +317,8 @@ };

if (params instanceof Error) {
const result = {};
result.stack = params.stack;
// const result = JSON.parse(JSON.stringify(params));
const result = { ...params };
console.warn(result instanceof Error);
result.stack_array = _.split(params.stack, '\n').filter(o => o);
result.error_message = params.message;
result.message = undefined;
return result;

@@ -334,3 +341,3 @@ } else {

} else if (typeof message === 'object') {
params = message;
params = checkForError(message);
}

@@ -341,3 +348,3 @@

} else if (typeof level === 'object') {
params = level;
params = checkForError(level);
}

@@ -344,0 +351,0 @@

{
"name": "@geek/logger",
"version": "1.0.1",
"version": "1.0.2",
"description": "Logging module for Node.js and Axway Titanium",

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

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