|
5 | 5 | * LICENSE file in the root directory of this source tree.
|
6 | 6 | */
|
7 | 7 |
|
| 8 | +use common::ConsoleLogger; |
8 | 9 | use env_logger::Env;
|
9 |
| -use log::{error, info}; |
| 10 | +use log::{error, info, Level}; |
10 | 11 | use relay_compiler::{
|
11 | 12 | compiler::Compiler,
|
12 | 13 | config::{Config, SingleProjectConfigFile, TypegenLanguage},
|
13 | 14 | FileSourceKind, RemotePersister,
|
14 | 15 | };
|
| 16 | +use std::io::Write; |
15 | 17 | use std::{
|
16 | 18 | env::{self, current_dir},
|
17 | 19 | path::PathBuf,
|
@@ -74,7 +76,16 @@ impl From<CliConfig> for SingleProjectConfigFile {
|
74 | 76 |
|
75 | 77 | #[tokio::main]
|
76 | 78 | async fn main() {
|
77 |
| - env_logger::from_env(Env::default().default_filter_or("info")).init(); |
| 79 | + env_logger::Builder::from_env(Env::default().default_filter_or("info")) |
| 80 | + .format(|buf, record| { |
| 81 | + let style = buf.default_level_style(record.level()); |
| 82 | + if record.level() == Level::Info { |
| 83 | + writeln!(buf, "{}", record.args()) |
| 84 | + } else { |
| 85 | + writeln!(buf, "[{}] {}", style.value(record.level()), record.args()) |
| 86 | + } |
| 87 | + }) |
| 88 | + .init(); |
78 | 89 |
|
79 | 90 | let opt = Opt::from_args();
|
80 | 91 |
|
@@ -103,7 +114,7 @@ async fn main() {
|
103 | 114 | );
|
104 | 115 | }
|
105 | 116 |
|
106 |
| - let compiler = Compiler::new(Arc::new(config), Arc::new(common::NoopPerfLogger)); |
| 117 | + let compiler = Compiler::new(Arc::new(config), Arc::new(ConsoleLogger)); |
107 | 118 |
|
108 | 119 | if opt.watch {
|
109 | 120 | if let Err(err) = compiler.watch().await {
|
|
0 commit comments