smartlog-interfaces/ts/index.ts

66 lines
1.1 KiB
TypeScript
Raw Normal View History

2019-10-22 13:10:32 +00:00
import * as plugins from './smartlog-interfaces.plugins';
/**
* the different available log types
*/
export type TLogType =
| 'log'
| 'increment'
| 'gauge'
| 'error'
| 'success'
| 'value'
| 'finance'
2018-11-16 19:27:21 +00:00
| 'compliance';
/**
* the available log levels
*/
2018-11-16 19:27:21 +00:00
export type TLogLevel =
| 'silly'
| 'info'
| 'debug'
| 'note'
| 'ok'
| 'success'
| 'warn'
| 'error'
| 'lifecycle';
/**
* the available environments
*/
2018-03-01 21:33:47 +00:00
export type TEnvironment = 'local' | 'test' | 'staging' | 'production';
/**
* the available runtimes
*/
export type TRuntime = 'node' | 'chrome' | 'rust';
2018-02-08 00:52:08 +00:00
export interface ILogContext {
company?: string;
companyunit?: string;
containerName?: string;
environment: TEnvironment;
runtime: TRuntime;
2018-11-04 17:15:46 +00:00
zone: string;
2018-02-08 00:52:08 +00:00
}
2018-03-01 21:33:47 +00:00
export interface ILogPackage {
2018-11-04 17:15:46 +00:00
timestamp: number;
type: TLogType;
context: ILogContext;
level: TLogLevel;
2018-03-01 21:33:47 +00:00
message: string;
2018-11-04 17:15:46 +00:00
data?: any;
2018-02-28 23:32:21 +00:00
}
2018-10-31 12:49:12 +00:00
export interface ILogPackageAuthenticated {
auth: string;
logPackage: ILogPackage;
}
2018-02-28 23:32:21 +00:00
export interface ILogDestination {
2018-03-01 22:31:47 +00:00
handleLog: (logPackage: ILogPackage) => void;
2018-03-01 21:33:47 +00:00
}