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 { expect, tap } from 'tapbundle';
|
||||||
import * as commonlog from '../ts/index'
|
import * as commonlog from '../ts/index';
|
||||||
|
|
||||||
tap.test('first test', async () => {
|
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();
|
||||||
|
21
ts/index.ts
21
ts/index.ts
@ -1,10 +1,6 @@
|
|||||||
export type TLogLevel =
|
export type TLogLevel = 'error' | 'warn' | 'info' | 'verbose' | 'debug' | 'silly';
|
||||||
| "error"
|
export type TEnvironment = 'local' | 'test' | 'staging' | 'production';
|
||||||
| "warn"
|
export type TRuntime = 'node' | 'browser';
|
||||||
| "info"
|
|
||||||
| "verbose"
|
|
||||||
| "debug"
|
|
||||||
| "silly";
|
|
||||||
|
|
||||||
export interface ILogContext {
|
export interface ILogContext {
|
||||||
zone?: string;
|
zone?: string;
|
||||||
@ -15,13 +11,12 @@ export interface ILogContext {
|
|||||||
runtime: TRuntime;
|
runtime: TRuntime;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TEnvironment = "local" | "test" | "staging" | "production";
|
export interface ILogPackage {
|
||||||
export type TRuntime = "node" | "browser";
|
logContext: ILogContext;
|
||||||
|
logLevel: TLogLevel
|
||||||
export interface IHandleLogFunc {
|
message: string;
|
||||||
(logObject): void
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ILogDestination {
|
export interface ILogDestination {
|
||||||
handleLog: IHandleLogFunc
|
handleLog: (ILogPackage) => void;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user