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

@openfn/logger

Package Overview
Dependencies
Maintainers
4
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openfn/logger - npm Package Compare versions

Comparing version 0.0.17 to 0.0.18

CHANGELOG.md

4

dist/index.d.ts

@@ -40,2 +40,4 @@ type SanitizePolicies = 'remove' | 'obfuscate' | 'summarize' | 'none';

always(...args: any[]): void;
proxy(obj: Partial<JSONLog>): void;
proxy(name: string, level: string, message: any[]): void;
print(...args: any[]): void;

@@ -70,2 +72,2 @@ confirm(message: string, force?: boolean): Promise<boolean>;

export { JSONLog, LogLevel, LogOptions, Logger, StringLog, mockLogger as createMockLogger, export_default as default, defaultLogger, _default$1 as isValidLogLevel, _default as printDuration };
export { JSONLog, LogLevel, LogOptions, Logger, SanitizePolicies, StringLog, mockLogger as createMockLogger, export_default as default, defaultLogger, _default$1 as isValidLogLevel, _default as printDuration };

@@ -116,2 +116,5 @@ // src/logger.ts

...console,
// Direct error and warn logs to stdout, so that they appear in sequence
error: (...args) => console.log(...args),
warn: (...args) => console.log(...args),
success: (...args) => console.log(...args),

@@ -185,12 +188,12 @@ always: (...args) => console.log(...args)

const emitter = opts.logger;
const log = (level, ...args) => {
const log = (name2, level, ...args) => {
if (priority[level] >= minLevel) {
if (options.json) {
logJSON(level, ...args);
logJSON(name2, level, ...args);
} else {
logString(level, ...args);
logString(name2, level, ...args);
}
}
};
const logJSON = (level, ...args) => {
const logJSON = (name2, level, ...args) => {
const message = args.map(

@@ -207,3 +210,3 @@ (o) => sanitize_default(o, {

level,
name,
name: name2,
message,

@@ -215,3 +218,3 @@ time: Date.now()

};
const logString = (level, ...args) => {
const logString = (name2, level, ...args) => {
if (emitter.hasOwnProperty(level)) {

@@ -230,4 +233,4 @@ const cleanedArgs = args.map(

const output = [];
if (name && !opts.hideNamespace) {
output.push(c.blue(`[${name}]`));
if (name2 && !opts.hideNamespace) {
output.push(c.blue(`[${name2}]`));
}

@@ -241,2 +244,13 @@ if (!opts.hideIcons) {

};
const proxy = function(...args) {
let j;
if (args.length === 3) {
const [name2, level, message] = args;
j = { name: name2, level, message };
} else {
j = args[0];
}
j = j;
log(j.name, j.level, ...j.message);
};
const print = (...args) => {

@@ -266,3 +280,3 @@ if (opts.level !== NONE) {

};
const wrap = (level) => (...args) => log(level, ...args);
const wrap = (level) => (...args) => log(name, level, ...args);
const logger = {

@@ -279,2 +293,3 @@ info: wrap(INFO),

print,
proxy,
// possible convenience APIs

@@ -281,0 +296,0 @@ force: () => {

{
"name": "@openfn/logger",
"version": "0.0.17",
"version": "0.0.18",
"description": "Cross-package logging utility",

@@ -37,3 +37,4 @@ "module": "dist/index.js",

"dist",
"README.md"
"README.md",
"CHANGELOG.md"
],

@@ -40,0 +41,0 @@ "scripts": {

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