electron-log
Advanced tools
Comparing version 5.1.7 to 5.2.0
{ | ||
"name": "electron-log", | ||
"version": "5.1.7", | ||
"version": "5.2.0", | ||
"description": "Just a simple logging module for your Electron application", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -56,6 +56,7 @@ 'use strict'; | ||
this.addLevel('log', false); | ||
for (const name of this.levels) { | ||
this.addLevel(name, false); | ||
} | ||
this.log = this.info; | ||
this.functions.log = this.log; | ||
@@ -118,2 +119,3 @@ this.errorHandler = errorHandler; | ||
const check = levels.indexOf(checkLevel); | ||
if (check === -1 || pass === -1) { | ||
@@ -120,0 +122,0 @@ return true; |
@@ -9,4 +9,12 @@ import { ClientRequest, RequestOptions } from 'http'; | ||
type Format = (({ message: LogMessage }) => any[]) | string; | ||
interface FormatParams { | ||
data: any[]; | ||
level: LogLevel; | ||
logger: Logger; | ||
message: LogMessage; | ||
transport: Transport; | ||
} | ||
type Format = string | ((params: FormatParams) => any[]); | ||
type FOpenFlags = 'r' | 'r+' | 'rs+' | 'w' | 'wx' | 'w+' | 'wx+' | | ||
@@ -505,2 +513,9 @@ 'a' | 'ax' | 'a+' | 'ax+'; | ||
interface EventFormatterInput { | ||
args: unknown[]; | ||
event: object; | ||
eventName: string; | ||
eventSource: string; | ||
} | ||
interface EventLoggerOptions { | ||
@@ -510,11 +525,3 @@ /** | ||
*/ | ||
format?: | ||
| string | ||
| (( | ||
args: { | ||
eventName: string; | ||
eventSource: EventSource; | ||
handlerArgs: unknown[]; | ||
} | ||
) => unknown[]); | ||
format?: string | ((input: EventFormatterInput) => unknown[]); | ||
@@ -526,17 +533,7 @@ /** | ||
EventSource, | ||
Record< | ||
string, | ||
( | ||
args: { | ||
args: unknown[]; | ||
event: object; | ||
eventName: string; | ||
eventSource: string; | ||
} | ||
) => unknown | ||
> | ||
Record<string, (input: EventFormatterInput) => object | unknown[]> | ||
>; | ||
/** | ||
* Allow to switch specific events on/off easily | ||
* Allow switching specific events on/off easily | ||
*/ | ||
@@ -543,0 +540,0 @@ events?: Record<EventSource, Record<string, boolean>>; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91301
2909