-
-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(rstream-log): update to use base types from @thi.ng/api pkg
- Loading branch information
1 parent
8a87bd0
commit ef9bf8d
Showing
4 changed files
with
50 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,20 @@ | ||
import { IID } from "@thi.ng/api"; | ||
import { IID, ILogger as APILogger, LogLevel } from "@thi.ng/api"; | ||
import { ISubscribable } from "@thi.ng/rstream"; | ||
|
||
export enum Level { | ||
FINE, | ||
DEBUG, | ||
INFO, | ||
WARN, | ||
SEVERE, | ||
NONE | ||
} | ||
|
||
/** | ||
* Reverse lookup for `Level` enums | ||
*/ | ||
// export const __Level = (<any>exports).Level; | ||
|
||
export interface LogEntry extends Array<any> { | ||
[0]: Level; | ||
[0]: LogLevel; | ||
[1]: string; | ||
[2]: number; | ||
[id: number]: any; | ||
} | ||
|
||
export interface LogEntryObj extends IID<string> { | ||
level: Level; | ||
level: LogLevel; | ||
time: number; | ||
body: any[]; | ||
} | ||
|
||
export interface ILogger extends ISubscribable<LogEntry> { | ||
fine(...args: any[]); | ||
debug(...args: any[]); | ||
info(...args: any[]); | ||
warn(...args: any[]); | ||
severe(...args: any[]); | ||
} | ||
export interface ILogger extends APILogger, ISubscribable<LogEntry> {} | ||
|
||
export type DateFormat = (epoch: number) => string; | ||
export type BodyFormat = (body: any[]) => string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters