add ILogPackage
This commit is contained in:
parent
fa87873e01
commit
454f1182c6
10
test/test.ts
10
test/test.ts
@ -1,8 +1,8 @@
|
||||
import { expect, tap } from 'tapbundle'
|
||||
import * as commonlog from '../ts/index'
|
||||
import { expect, tap } from 'tapbundle';
|
||||
import * as commonlog from '../ts/index';
|
||||
|
||||
tap.test('first test', async () => {
|
||||
console.log('Since this is an interface package, there is nothing to test dynamically :)')
|
||||
})
|
||||
console.log('Since this is an interface package, there is nothing to test dynamically :)');
|
||||
});
|
||||
|
||||
tap.start()
|
||||
tap.start();
|
||||
|
23
ts/index.ts
23
ts/index.ts
@ -1,10 +1,6 @@
|
||||
export type TLogLevel =
|
||||
| "error"
|
||||
| "warn"
|
||||
| "info"
|
||||
| "verbose"
|
||||
| "debug"
|
||||
| "silly";
|
||||
export type TLogLevel = 'error' | 'warn' | 'info' | 'verbose' | 'debug' | 'silly';
|
||||
export type TEnvironment = 'local' | 'test' | 'staging' | 'production';
|
||||
export type TRuntime = 'node' | 'browser';
|
||||
|
||||
export interface ILogContext {
|
||||
zone?: string;
|
||||
@ -15,13 +11,12 @@ export interface ILogContext {
|
||||
runtime: TRuntime;
|
||||
}
|
||||
|
||||
export type TEnvironment = "local" | "test" | "staging" | "production";
|
||||
export type TRuntime = "node" | "browser";
|
||||
|
||||
export interface IHandleLogFunc {
|
||||
(logObject): void
|
||||
export interface ILogPackage {
|
||||
logContext: ILogContext;
|
||||
logLevel: TLogLevel
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface ILogDestination {
|
||||
handleLog: IHandleLogFunc
|
||||
}
|
||||
handleLog: (ILogPackage) => void;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user