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

View File

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