about summary refs log tree commit diff
path: root/tvix/store/src/bin/tvix-store.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-09-15T12·44+0200
committerflokli <flokli@flokli.de>2023-09-15T19·38+0000
commitb52bb6e7915c6f2cb481a90918ce6483f0a43ad4 (patch)
tree59d94235537ffeb93623ad15aff1e2b2d650f182 /tvix/store/src/bin/tvix-store.rs
parentd111a0fda8e45725b655a3661370624a4588fc50 (diff)
fix(tvix/store): log to stderr, not stdout r/6594
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>
Diffstat (limited to 'tvix/store/src/bin/tvix-store.rs')
-rw-r--r--tvix/store/src/bin/tvix-store.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/tvix/store/src/bin/tvix-store.rs b/tvix/store/src/bin/tvix-store.rs
index 3e1c0ef9ae75..7f6766d00ef2 100644
--- a/tvix/store/src/bin/tvix-store.rs
+++ b/tvix/store/src/bin/tvix-store.rs
@@ -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!(