mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 02:22:40 +00:00
console.warn goes to stderr (#810)
This commit is contained in:
parent
ad5065e23e
commit
f156a86024
4 changed files with 13 additions and 8 deletions
|
@ -110,7 +110,7 @@ export function stringifyArgs(args: any[]): string {
|
|||
return out.join(" ");
|
||||
}
|
||||
|
||||
type PrintFunc = (x: string) => void;
|
||||
type PrintFunc = (x: string, isErr?: boolean) => void;
|
||||
|
||||
export class Console {
|
||||
constructor(private printFunc: PrintFunc) {}
|
||||
|
@ -125,8 +125,7 @@ export class Console {
|
|||
|
||||
// tslint:disable-next-line:no-any
|
||||
warn(...args: any[]): void {
|
||||
// TODO Log to stderr.
|
||||
this.printFunc(stringifyArgs(args));
|
||||
this.printFunc(stringifyArgs(args), true);
|
||||
}
|
||||
|
||||
error = this.warn;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue