Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagecell
Path: blob/master/js/console.js
447 views
1
import sagecell from "./sagecell";
2
3
export const origConsole = window.console;
4
5
/**
6
* A replacement for window.console that suppresses logging based on `sagecell.quietMode`
7
*/
8
export const console = {
9
log(...args) {
10
if (sagecell.quietMode) {
11
return;
12
}
13
origConsole.log(...args);
14
},
15
info(...args) {
16
if (sagecell.quietMode) {
17
return;
18
}
19
origConsole.info(...args);
20
},
21
debug(...args) {
22
if (sagecell.quietMode) {
23
return;
24
}
25
origConsole.debug(...args);
26
},
27
error(...args) {
28
origConsole.error(...args);
29
},
30
warn(...args) {
31
origConsole.warn(...args);
32
},
33
};
34
35