@larvit/log 1.0.4 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- package/index.d.ts +6 -7
- package/index.ts +6 -6
- package/package.json +1 -1
package/index.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
declare type Metadata = {
|
1
|
+
export declare type Metadata = {
|
2
2
|
[key: string]: string;
|
3
3
|
};
|
4
|
-
declare type LogShorthand = (msg: string, metadata?: Metadata) => void;
|
5
|
-
interface LogInt {
|
4
|
+
export declare type LogShorthand = (msg: string, metadata?: Metadata) => void;
|
5
|
+
export interface LogInt {
|
6
6
|
error: LogShorthand;
|
7
7
|
warn: LogShorthand;
|
8
8
|
info: LogShorthand;
|
@@ -10,13 +10,13 @@ interface LogInt {
|
|
10
10
|
debug: LogShorthand;
|
11
11
|
silly: LogShorthand;
|
12
12
|
}
|
13
|
-
declare type LogLevel = keyof LogInt;
|
14
|
-
declare type EntryFormatterConf = {
|
13
|
+
export declare type LogLevel = keyof LogInt;
|
14
|
+
export declare type EntryFormatterConf = {
|
15
15
|
logLevel: LogLevel;
|
16
16
|
metadata?: Metadata;
|
17
17
|
msg: string;
|
18
18
|
};
|
19
|
-
declare type LogConf = {
|
19
|
+
export declare type LogConf = {
|
20
20
|
context?: Metadata;
|
21
21
|
entryFormatter?: (conf: EntryFormatterConf) => string;
|
22
22
|
format?: "text" | "json";
|
@@ -37,4 +37,3 @@ export declare class Log implements LogInt {
|
|
37
37
|
debug(msg: string, metadata?: Metadata): void;
|
38
38
|
silly(msg: string, metadata?: Metadata): void;
|
39
39
|
}
|
40
|
-
export {};
|
package/index.ts
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
type Metadata = {
|
1
|
+
export type Metadata = {
|
2
2
|
[key: string]: string;
|
3
3
|
}
|
4
4
|
|
5
|
-
type LogShorthand = (msg: string, metadata?: Metadata) => void;
|
5
|
+
export type LogShorthand = (msg: string, metadata?: Metadata) => void;
|
6
6
|
|
7
|
-
interface LogInt {
|
7
|
+
export interface LogInt {
|
8
8
|
/* eslint-disable typescript-sort-keys/interface */
|
9
9
|
error: LogShorthand;
|
10
10
|
warn: LogShorthand;
|
@@ -15,15 +15,15 @@ interface LogInt {
|
|
15
15
|
/* eslint-enable typescript-sort-keys/interface */
|
16
16
|
}
|
17
17
|
|
18
|
-
type LogLevel = keyof LogInt;
|
18
|
+
export type LogLevel = keyof LogInt;
|
19
19
|
|
20
|
-
type EntryFormatterConf = {
|
20
|
+
export type EntryFormatterConf = {
|
21
21
|
logLevel: LogLevel;
|
22
22
|
metadata?: Metadata;
|
23
23
|
msg: string;
|
24
24
|
}
|
25
25
|
|
26
|
-
type LogConf = {
|
26
|
+
export type LogConf = {
|
27
27
|
context?: Metadata;
|
28
28
|
entryFormatter?: (conf: EntryFormatterConf) => string;
|
29
29
|
format?: "text" | "json";
|