@maestro-js/log 1.0.0-alpha.16 → 1.0.0-alpha.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +12 -11
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -87,10 +87,11 @@ declare function StubTransport<LogMessageData extends any[] = any[]>(options?: {
|
|
|
87
87
|
|
|
88
88
|
declare function withRedactions<T extends LogTransport<D>, D extends any[] = any[]>(transport: T, options: WithRedactionsOptions): T;
|
|
89
89
|
|
|
90
|
+
type LogWithRedactionsOptions = WithRedactionsOptions;
|
|
90
91
|
/**
|
|
91
92
|
* Creates a new logger. By default loggers have no transports
|
|
92
93
|
*/
|
|
93
|
-
declare function create<LoggerMessageData extends any[] = any>(config?: Log.Config<LoggerMessageData>): Log.Logger<LoggerMessageData>;
|
|
94
|
+
declare function create<LoggerMessageData extends any[] = any[]>(config?: Log.Config<LoggerMessageData>): Log.Logger<LoggerMessageData>;
|
|
94
95
|
/**
|
|
95
96
|
* Monkey patches the default console methods with methods
|
|
96
97
|
* from the supplied logger. Returns a function that restores
|
|
@@ -136,7 +137,7 @@ declare function overrideNodeJsConsole(logger: LogFunctions): () => void;
|
|
|
136
137
|
*/
|
|
137
138
|
declare namespace Log {
|
|
138
139
|
/** Configuration options passed to {@link Log.create}. */
|
|
139
|
-
interface Config<LoggerMessageData extends any[] = any> {
|
|
140
|
+
interface Config<LoggerMessageData extends any[] = any[]> {
|
|
140
141
|
transports?: Log.Transport<LoggerMessageData>[];
|
|
141
142
|
}
|
|
142
143
|
/**
|
|
@@ -200,7 +201,7 @@ declare namespace Log {
|
|
|
200
201
|
/** Destination that receives {@link Log.Message messages} from a logger. */
|
|
201
202
|
type Transport<LogMessageData extends any[] = any[]> = LogTransport<LogMessageData>;
|
|
202
203
|
/** Options for {@link Log.withRedactions}. */
|
|
203
|
-
type WithRedactionsOptions =
|
|
204
|
+
type WithRedactionsOptions = LogWithRedactionsOptions;
|
|
204
205
|
}
|
|
205
206
|
/**
|
|
206
207
|
* Structured logging with pluggable transports.
|
|
@@ -209,14 +210,14 @@ declare namespace Log {
|
|
|
209
210
|
declare const Log: {
|
|
210
211
|
create: typeof create;
|
|
211
212
|
overrideNodeJsConsole: typeof overrideNodeJsConsole;
|
|
212
|
-
write: (message: Omit<LogMessage<any>, "channel">) => void;
|
|
213
|
-
info: (...data: any) => void;
|
|
214
|
-
warn: (...data: any) => void;
|
|
215
|
-
error: (...data: any) => void;
|
|
216
|
-
emergency: (...data: any) => void;
|
|
217
|
-
addTransport: (...transport: Log.Transport<any>[]) => void;
|
|
218
|
-
removeTransport: (...transport: Log.Transport<any>[]) => void;
|
|
219
|
-
channel: <ChannelMessageData extends any = any>(channel: LogChannel) => Log.LogFunctions<ChannelMessageData>;
|
|
213
|
+
write: (message: Omit<LogMessage<any[]>, "channel">) => void;
|
|
214
|
+
info: (...data: any[]) => void;
|
|
215
|
+
warn: (...data: any[]) => void;
|
|
216
|
+
error: (...data: any[]) => void;
|
|
217
|
+
emergency: (...data: any[]) => void;
|
|
218
|
+
addTransport: (...transport: Log.Transport<any[]>[]) => void;
|
|
219
|
+
removeTransport: (...transport: Log.Transport<any[]>[]) => void;
|
|
220
|
+
channel: <ChannelMessageData extends any[] = any[]>(channel: LogChannel) => Log.LogFunctions<ChannelMessageData>;
|
|
220
221
|
withRedactions: typeof withRedactions;
|
|
221
222
|
commonSensitiveKeys: readonly ["password", "secret", "token", "accessToken", "refreshToken", "apiKey", "apiSecret", "authorization", "cookie", "creditCard", "ssn", "socialSecurityNumber"];
|
|
222
223
|
transports: {
|