@maestro-js/log 1.0.0-alpha.22 → 1.0.0-alpha.3
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 +11 -12
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -87,11 +87,10 @@ 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;
|
|
91
90
|
/**
|
|
92
91
|
* Creates a new logger. By default loggers have no transports
|
|
93
92
|
*/
|
|
94
|
-
declare function create<LoggerMessageData extends any[] = any
|
|
93
|
+
declare function create<LoggerMessageData extends any[] = any>(config?: Log.Config<LoggerMessageData>): Log.Logger<LoggerMessageData>;
|
|
95
94
|
/**
|
|
96
95
|
* Monkey patches the default console methods with methods
|
|
97
96
|
* from the supplied logger. Returns a function that restores
|
|
@@ -137,7 +136,7 @@ declare function overrideNodeJsConsole(logger: LogFunctions): () => void;
|
|
|
137
136
|
*/
|
|
138
137
|
declare namespace Log {
|
|
139
138
|
/** Configuration options passed to {@link Log.create}. */
|
|
140
|
-
interface Config<LoggerMessageData extends any[] = any
|
|
139
|
+
interface Config<LoggerMessageData extends any[] = any> {
|
|
141
140
|
transports?: Log.Transport<LoggerMessageData>[];
|
|
142
141
|
}
|
|
143
142
|
/**
|
|
@@ -201,7 +200,7 @@ declare namespace Log {
|
|
|
201
200
|
/** Destination that receives {@link Log.Message messages} from a logger. */
|
|
202
201
|
type Transport<LogMessageData extends any[] = any[]> = LogTransport<LogMessageData>;
|
|
203
202
|
/** Options for {@link Log.withRedactions}. */
|
|
204
|
-
type WithRedactionsOptions =
|
|
203
|
+
type WithRedactionsOptions = WithRedactionsOptions;
|
|
205
204
|
}
|
|
206
205
|
/**
|
|
207
206
|
* Structured logging with pluggable transports.
|
|
@@ -210,14 +209,14 @@ declare namespace Log {
|
|
|
210
209
|
declare const Log: {
|
|
211
210
|
create: typeof create;
|
|
212
211
|
overrideNodeJsConsole: typeof overrideNodeJsConsole;
|
|
213
|
-
write: (message: Omit<LogMessage<any
|
|
214
|
-
info: (...data: any
|
|
215
|
-
warn: (...data: any
|
|
216
|
-
error: (...data: any
|
|
217
|
-
emergency: (...data: any
|
|
218
|
-
addTransport: (...transport: Log.Transport<any
|
|
219
|
-
removeTransport: (...transport: Log.Transport<any
|
|
220
|
-
channel: <ChannelMessageData extends any
|
|
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>;
|
|
221
220
|
withRedactions: typeof withRedactions;
|
|
222
221
|
commonSensitiveKeys: readonly ["password", "secret", "token", "accessToken", "refreshToken", "apiKey", "apiSecret", "authorization", "cookie", "creditCard", "ssn", "socialSecurityNumber"];
|
|
223
222
|
transports: {
|