Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use rust logging API #5525

Merged
merged 2 commits into from
Feb 28, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/rust/engine/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/rust/engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ fs = { path = "fs" }
futures = "0.1.16"
hashing = { path = "hashing" }
lazy_static = "0.2.2"
log = "0.4"
ordermap = "0.2.8"
petgraph = "0.4.5"
process_execution = { path = "process_execution" }
Expand Down
47 changes: 47 additions & 0 deletions src/rust/engine/fs/fs_util/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/rust/engine/fs/fs_util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ bazel_protos = { path = "../../process_execution/bazel_protos" }
boxfuture = { path = "../../boxfuture" }
bytes = "0.4.5"
clap = "2"
env_logger = "0.5.4"
fs = { path = ".." }
futures = "0.1.16"
hashing = { path = "../../hashing" }
Expand Down
3 changes: 3 additions & 0 deletions src/rust/engine/fs/fs_util/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ extern crate bazel_protos;
extern crate boxfuture;
extern crate bytes;
extern crate clap;
extern crate env_logger;
extern crate fs;
extern crate futures;
extern crate hashing;
Expand Down Expand Up @@ -37,6 +38,8 @@ impl From<String> for ExitError {
}

fn main() {
env_logger::init();

match execute(
App::new("fs_util")
.subcommand(
Expand Down
1 change: 1 addition & 0 deletions src/rust/engine/process_execution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ fs = { path = "../fs" }
futures = "0.1.16"
grpcio = { version = "0.2.0", features = ["secure"] }
hashing = { path = "../hashing" }
log = "0.4"
protobuf = { version = "1.4.1", features = ["with-bytes"] }
sha2 = "0.6.0"
tempdir = "0.3.5"
Expand Down
2 changes: 2 additions & 0 deletions src/rust/engine/process_execution/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ extern crate fs;
extern crate futures;
extern crate grpcio;
extern crate hashing;
#[macro_use]
extern crate log;
#[cfg(test)]
extern crate mock;
extern crate protobuf;
Expand Down
7 changes: 3 additions & 4 deletions src/rust/engine/process_execution/src/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ impl CommandRunner {
Ok((command, execute_request)) => {
self.upload_command(&command, execute_request.get_action().get_command_digest().into())
.and_then(move |_| {
// TODO: Log less verbosely
println!("Executing remotely request: {:?} (command: {:?})", execute_request, command);
debug!("Executing remotely request: {:?} (command: {:?})", execute_request, command);

map_grpc_result(execution_client.execute(&execute_request))
.map(|result| (Arc::new(execute_request), result))
Expand Down Expand Up @@ -194,7 +193,7 @@ fn extract_execute_response(
mut operation: bazel_protos::operations::Operation,
) -> Result<ExecuteProcessResult, ExecutionError> {
// TODO: Log less verbosely
println!("Got operation response: {:?}", operation);
debug!("Got operation response: {:?}", operation);
if !operation.get_done() {
return Err(ExecutionError::NotFinished(operation.take_name()));
}
Expand All @@ -213,7 +212,7 @@ fn extract_execute_response(
ExecutionError::Fatal(format!("Invalid ExecuteResponse: {:?}", e))
})?;
// TODO: Log less verbosely
println!("Got (nested) execute response: {:?}", execute_response);
debug!("Got (nested) execute response: {:?}", execute_response);

match grpcio::RpcStatusCode::from(execute_response.get_status().get_code()) {
grpcio::RpcStatusCode::Ok => Ok(ExecuteProcessResult {
Expand Down
48 changes: 48 additions & 0 deletions src/rust/engine/process_executor/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading