diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2019-02-03 10:27:53 +1100 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-02-02 18:27:53 -0500 |
commit | efa1eeb8b39cb38b5641a0ee8eab1837beaab4af (patch) | |
tree | cd19bdac24b03a6869872553c66874cc31cfcc10 /js/util.ts | |
parent | c3241822522fb2b13792fe5666596888057cf829 (diff) |
Compiler cleanups and minor improvements (#1656)
Diffstat (limited to 'js/util.ts')
-rw-r--r-- | js/util.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/js/util.ts b/js/util.ts index f9ca6ced4..542356da0 100644 --- a/js/util.ts +++ b/js/util.ts @@ -2,10 +2,14 @@ import { TypedArray } from "./types"; let logDebug = false; +let logSource = "JS"; // @internal -export function setLogDebug(debug: boolean): void { +export function setLogDebug(debug: boolean, source?: string): void { logDebug = debug; + if (source) { + logSource = source; + } } /** Debug logging for deno. @@ -15,7 +19,7 @@ export function setLogDebug(debug: boolean): void { // tslint:disable-next-line:no-any export function log(...args: any[]): void { if (logDebug) { - console.log("DEBUG JS -", ...args); + console.log(`DEBUG ${logSource} -`, ...args); } } |