New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@join-com/gcloud-logger

Package Overview
Dependencies
Maintainers
32
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@join-com/gcloud-logger - npm Package Compare versions

Comparing version 1.4.0-alpha.1 to 1.4.0-alpha.2

4

dist/Logger.d.ts

@@ -10,3 +10,3 @@ export declare enum Level {

private readonly logger;
constructor(usePrettyPrint: boolean, logLevelStarts?: string, excludeKeys?: string[]);
constructor(disablePrettyPrint: boolean, logLevelStarts?: string, excludeKeys?: string[]);
debug(message: string, payload?: unknown): void;

@@ -16,3 +16,3 @@ info(message: string, payload?: unknown): void;

error(message: string, payload?: unknown): void;
critical(message: string, payload?: unknown): void;
fatal(message: string, payload?: unknown): void;
reportError(err: unknown): void;

@@ -19,0 +19,0 @@ private getMessage;

@@ -32,5 +32,24 @@ "use strict";

}));
const OldLogLevelToPinoLevel = new Map(Object.entries({
DEFAULT: 'info',
DEBUG: 'debug',
INFO: 'info',
NOTICE: 'info',
WARNING: 'warn',
ERROR: 'error',
CRITICAL: 'fatal',
ALERT: 'fatal',
EMERGENCY: 'fatal'
}));
class Logger {
constructor(usePrettyPrint, logLevelStarts, excludeKeys = ['password', 'token', 'newPassword', 'oldPassword']) {
const defaultPinoConf = {
constructor(disablePrettyPrint, logLevelStarts, excludeKeys = ['password', 'token', 'newPassword', 'oldPassword']) {
let logLevel = logLevelStarts || 'info';
if (!PinoLevelToCloudLevelLookup.has(logLevel)) {
logLevel = OldLogLevelToPinoLevel.get(logLevel) || 'info';
}
const pinoConfig = {
base: undefined,
timestamp: false,
level: logLevel,
redact: excludeKeys,
messageKey: 'message',

@@ -47,9 +66,6 @@ formatters: {

};
const transport = usePrettyPrint ? { target: 'pino-pretty' } : { target: '' };
this.logger = (0, pino_1.default)({
level: logLevelStarts,
redact: excludeKeys,
defaultPinoConf,
transport,
});
if (!disablePrettyPrint) {
pinoConfig['transport'] = { target: 'pino-pretty' };
}
this.logger = (0, pino_1.default)(pinoConfig);
}

@@ -68,3 +84,3 @@ debug(message, payload) {

}
critical(message, payload) {
fatal(message, payload) {
this.logger.fatal(payload, message);

@@ -71,0 +87,0 @@ }

{
"name": "@join-com/gcloud-logger",
"version": "1.4.0-alpha.1",
"version": "1.4.0-alpha.2",
"description": "gcloud simple logger",

@@ -5,0 +5,0 @@ "author": "JOIN Solutions",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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