about summary refs log tree commit diff
path: root/tvix/store/src/dummy_path_info_service.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2022-12-28T16·17+0100
committerflokli <flokli@flokli.de>2022-12-30T20·25+0000
commit319c03f63413a82d9266ed939eba7f7e552dd2b2 (patch)
tree7ed69310905fd8f4d7250aca3eb0976119f62a70 /tvix/store/src/dummy_path_info_service.rs
parent0bf2b0ef1164aae0ad692066e8cfc0b243a89e4d (diff)
feat(tvix/store): add logging with tracing r/5558
This uses [tracing](https://github.com/tokio-rs/tracing) for logs/
tracing.

Annotate all method handlers with an instrument macro, and warn! a
message for them being unimplemented.

Co-Authored-By: Márton Boros <martonboros@gmail.com>
Change-Id: Id42a41db33782d82abfb8dc0e49a8915000e5d89
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7665
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/store/src/dummy_path_info_service.rs')
-rw-r--r--tvix/store/src/dummy_path_info_service.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/tvix/store/src/dummy_path_info_service.rs b/tvix/store/src/dummy_path_info_service.rs
index 3bc99ad334d9..93359377f3dc 100644
--- a/tvix/store/src/dummy_path_info_service.rs
+++ b/tvix/store/src/dummy_path_info_service.rs
@@ -4,23 +4,32 @@ use crate::proto::GetPathInfoRequest;
 use crate::proto::Node;
 use crate::proto::PathInfo;
 use tonic::{Request, Response, Result, Status};
+use tracing::{instrument, warn};
 
 pub struct DummyPathInfoService {}
 
+const NOT_IMPLEMENTED_MSG: &str = "not implemented";
+
 #[tonic::async_trait]
 impl PathInfoService for DummyPathInfoService {
+    #[instrument(skip(self))]
     async fn get(&self, _request: Request<GetPathInfoRequest>) -> Result<Response<PathInfo>> {
-        Err(Status::unimplemented("not implemented"))
+        warn!(NOT_IMPLEMENTED_MSG);
+        Err(Status::unimplemented(NOT_IMPLEMENTED_MSG))
     }
 
+    #[instrument(skip(self))]
     async fn put(&self, _request: Request<PathInfo>) -> Result<Response<PathInfo>> {
-        Err(Status::unimplemented("not implemented"))
+        warn!(NOT_IMPLEMENTED_MSG);
+        Err(Status::unimplemented(NOT_IMPLEMENTED_MSG))
     }
 
+    #[instrument(skip(self))]
     async fn calculate_nar(
         &self,
         _request: Request<Node>,
     ) -> Result<Response<CalculateNarResponse>> {
-        Err(Status::unimplemented("not implemented"))
+        warn!(NOT_IMPLEMENTED_MSG);
+        Err(Status::unimplemented(NOT_IMPLEMENTED_MSG))
     }
 }