fix(tvix/store): log to stderr, not stdout

This leaves some space in stdout to provide actual meaningful output.

Also, rename print_node to log_node because that's what it does, it's
using the logger to log out more detailed info.

Change-Id: Ic64a6330dbfcdc63eb4198067a5c5e47b841b9a5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9336
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: Connor Brewster <cbrewster@hey.com>
Reviewed-by: Adam Joseph <adam@westernsemico.com>
This commit is contained in:
Florian Klink 2023-09-15 14:44:10 +02:00 committed by flokli
parent d111a0fda8
commit b52bb6e791

View file

@ -110,7 +110,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.with(if cli.json {
Some(
tracing_subscriber::fmt::Layer::new()
.with_writer(io::stdout.with_max_level(level))
.with_writer(io::stderr.with_max_level(level))
.json(),
)
} else {
@ -119,7 +119,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.with(if !cli.json {
Some(
tracing_subscriber::fmt::Layer::new()
.with_writer(io::stdout.with_max_level(level))
.with_writer(io::stderr.with_max_level(level))
.pretty(),
)
} else {
@ -241,7 +241,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
// from there (it might contain additional signatures).
let path_info = path_info_service.put(path_info)?;
print_node(&path_info.node.unwrap().node.unwrap(), &path);
log_node(&path_info.node.unwrap().node.unwrap(), &path);
Ok(())
});
task
@ -302,7 +303,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
Ok(())
}
fn print_node(node: &Node, path: &Path) {
fn log_node(node: &Node, path: &Path) {
match node {
Node::Directory(directory_node) => {
info!(