-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
132 additions
and
62 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Log } from "./log"; | ||
|
||
export class Context { | ||
public stdout: NodeJS.WritableStream; | ||
public stderr: NodeJS.WritableStream; | ||
public stdin: NodeJS.ReadableStream; | ||
public log: (msg: string) => void; | ||
public error: (msg?: string, error?: any) => void; | ||
public debug: (msg: string) => void; | ||
public info: (msg: string) => void; | ||
public exception: (exception: Error, level?: string) => void; | ||
|
||
public constructor() { | ||
this.stdout = process.stdout; | ||
this.stdin = process.stdin; | ||
this.stderr = process.stderr; | ||
this.log = console.log; | ||
this.error = console.error; | ||
this.debug = Log.log().debug; | ||
this.info = Log.log().info; | ||
this.exception = (exception: Error, level?: string) => Log.log().exception(level || Log.level.error, exception); | ||
} | ||
} |
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
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
Oops, something went wrong.