summaryrefslogtreecommitdiff
path: root/js/util.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/util.ts')
-rw-r--r--js/util.ts15
1 files changed, 8 insertions, 7 deletions
diff --git a/js/util.ts b/js/util.ts
index c1e84610f..c03e47140 100644
--- a/js/util.ts
+++ b/js/util.ts
@@ -1,16 +1,17 @@
// Copyright 2018 the Deno authors. All rights reserved. MIT license.
+import { TypedArray } from "./types";
-//import { debug } from "./main";
-const debug = false;
+let logDebug = false;
-import { TypedArray } from "./types";
+export function setLogDebug(debug: boolean): void {
+ logDebug = debug;
+}
-// Internal logging for deno. Use the "debug" variable above to control
-// output.
+// Debug logging for deno. Enable with the --DEBUG command line flag.
// tslint:disable-next-line:no-any
export function log(...args: any[]): void {
- if (debug) {
- console.log(...args);
+ if (logDebug) {
+ console.log("DEBUG JS -", ...args);
}
}