add ILogPackage

This commit is contained in:
Philipp Kunz 2018-03-01 22:33:47 +01:00
parent fa87873e01
commit 454f1182c6
2 changed files with 14 additions and 19 deletions

View File

@ -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();

View File

@ -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;
}