summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorYusuke Tanaka <yusuktan@maguro.dev>2020-09-23 00:08:10 +0900
committerGitHub <noreply@github.com>2020-09-22 11:08:10 -0400
commitc30c782c2c22d725c007623dbf43009999a2b184 (patch)
tree7720588f05fd95ffc45296be5ec9ae4a0d75f1ab /cli
parentcca8856fbf9552ccd7c6fe4eb6cbb8d521978a21 (diff)
fix(logger): change log level to which prefix added (#7582)
Diffstat (limited to 'cli')
-rw-r--r--cli/main.rs4
-rw-r--r--cli/tests/performance_stats.out24
-rw-r--r--cli/tests/type_directives_js_main.js.out4
3 files changed, 17 insertions, 15 deletions
diff --git a/cli/main.rs b/cli/main.rs
index 056280c9b..e2b61d33a 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -666,9 +666,11 @@ pub fn main() {
target.push(':');
target.push_str(&line_no.to_string());
}
- if record.level() >= Level::Info {
+ if record.level() <= Level::Info {
+ // Print ERROR, WARN, INFO logs as they are
writeln!(buf, "{}", record.args())
} else {
+ // Add prefix to DEBUG or TRACE logs
writeln!(
buf,
"{} RS - {} - {}",
diff --git a/cli/tests/performance_stats.out b/cli/tests/performance_stats.out
index 7943486d3..a18e59da9 100644
--- a/cli/tests/performance_stats.out
+++ b/cli/tests/performance_stats.out
@@ -1,14 +1,14 @@
[WILDCARD]
-Files: 46
-Nodes: [WILDCARD]
-Identifiers: [WILDCARD]
-Symbols: [WILDCARD]
-Types: [WILDCARD]
-Instantiations: [WILDCARD]
-Parse time: [WILDCARD]
-Bind time: [WILDCARD]
-Check time: [WILDCARD]
-Emit time: [WILDCARD]
-Total TS time: [WILDCARD]
-Compile time: [WILDCARD]
+DEBUG RS - [WILDCARD] - Files: 46
+DEBUG RS - [WILDCARD] - Nodes: [WILDCARD]
+DEBUG RS - [WILDCARD] - Identifiers: [WILDCARD]
+DEBUG RS - [WILDCARD] - Symbols: [WILDCARD]
+DEBUG RS - [WILDCARD] - Types: [WILDCARD]
+DEBUG RS - [WILDCARD] - Instantiations: [WILDCARD]
+DEBUG RS - [WILDCARD] - Parse time: [WILDCARD]
+DEBUG RS - [WILDCARD] - Bind time: [WILDCARD]
+DEBUG RS - [WILDCARD] - Check time: [WILDCARD]
+DEBUG RS - [WILDCARD] - Emit time: [WILDCARD]
+DEBUG RS - [WILDCARD] - Total TS time: [WILDCARD]
+DEBUG RS - [WILDCARD] - Compile time: [WILDCARD]
[WILDCARD]
diff --git a/cli/tests/type_directives_js_main.js.out b/cli/tests/type_directives_js_main.js.out
index 2ccecc904..9503e5273 100644
--- a/cli/tests/type_directives_js_main.js.out
+++ b/cli/tests/type_directives_js_main.js.out
@@ -1,3 +1,3 @@
[WILDCARD]
-fetch_source_file specifier: file:[WILDCARD]cli/tests/subdir/type_reference.d.ts [WILDCARD]
-[WILDCARD] \ No newline at end of file
+DEBUG RS - [WILDCARD] - fetch_source_file specifier: file:[WILDCARD]cli/tests/subdir/type_reference.d.ts [WILDCARD]
+[WILDCARD]