-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make logger export separate functions instead of object
- Loading branch information
Showing
3 changed files
with
13 additions
and
12 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
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,11 +1,12 @@ | ||
export const logger = { | ||
// log(...msgs: string[]) { | ||
// console.log('[YT-Defaulter]', ...msgs); | ||
// }, | ||
err(...msgs: readonly string[]) { | ||
console.error('[YT-Defaulter]', ...msgs); | ||
}, | ||
outOfRange(what: string) { | ||
this.err(what, 'value is out of range'); | ||
}, | ||
export const log = (...msgs: string[]) => { | ||
console.log('[YT-Defaulter]', ...msgs); | ||
}; | ||
export const err = (...msgs: readonly string[]) => { | ||
console.error('[YT-Defaulter]', ...msgs); | ||
}; | ||
export const outOfRange = (what: string) => { | ||
err(what, 'value is out of range'); | ||
}; | ||
export const trace = (msg: any, label?: string) => ( | ||
console.log(msg, label), msg | ||
); |
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