diff --git a/Cargo.lock b/Cargo.lock index ea3121a9de..10c5cffd88 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1240,7 +1240,6 @@ dependencies = [ "leo-package", "leo-state", "leo-typed", - "log", "num-bigint", "pest", "rand", diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index 7d281bb121..ba4060a3d3 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -29,7 +29,6 @@ snarkos-utilities = { version = "1.0.0" } bincode = { version = "1.0" } hex = { version = "0.4.2" } -log = { version = "0.4" } pest = { version = "2.0" } rand = { version = "0.7" } rand_xorshift = { version = "0.2", default-features = false } diff --git a/compiler/src/compiler.rs b/compiler/src/compiler.rs index 454103676a..d1d5b51fe8 100644 --- a/compiler/src/compiler.rs +++ b/compiler/src/compiler.rs @@ -133,7 +133,7 @@ impl> Compiler { self.program = typed_tree.into_repr(); self.imported_programs = ImportParser::parse(&self.program)?; - log::debug!("Program parsing complete\n{:#?}", self.program); + tracing::debug!("Program parsing complete\n{:#?}", self.program); Ok(()) } @@ -230,16 +230,16 @@ impl> ConstraintSynthesizer for Compil let output_directory = self.output_directory.clone(); let package_name = self.package_name.clone(); let result = self.generate_constraints_helper(cs).map_err(|e| { - log::error!("{}", e); + tracing::error!("{}", e); SynthesisError::Unsatisfiable })?; - log::info!("Program circuit successfully synthesized!"); + tracing::info!("Program circuit successfully synthesized!"); // Write results to file let output_file = OutputFile::new(&package_name); - log::info!("Writing to output registers..."); + tracing::info!("Writing to output registers..."); output_file.write(&output_directory, result.bytes()).unwrap(); diff --git a/compiler/src/console/console.rs b/compiler/src/console/console.rs index 1e2f8d2acf..637dc2bd37 100644 --- a/compiler/src/console/console.rs +++ b/compiler/src/console/console.rs @@ -25,21 +25,21 @@ impl> ConstrainedProgram { let string = self.format(cs, file_scope, function_scope, string)?; if unwrap_indicator_value(indicator) { - log::debug!("{}", string); + tracing::debug!("{}", string); } } ConsoleFunction::Error(string) => { let string = self.format(cs, file_scope, function_scope, string)?; if unwrap_indicator_value(indicator) { - log::error!("{}", string); + tracing::error!("{}", string); } } ConsoleFunction::Log(string) => { let string = self.format(cs, file_scope, function_scope, string)?; if unwrap_indicator_value(indicator) { - log::info!("{}", string); + tracing::info!("{}", string); } } } diff --git a/compiler/src/constraints/constraints.rs b/compiler/src/constraints/constraints.rs index d40933a51c..e2b170a4fc 100644 --- a/compiler/src/constraints/constraints.rs +++ b/compiler/src/constraints/constraints.rs @@ -78,7 +78,7 @@ pub fn generate_test_constraints>( // Get default input let default = input.pairs.get(&program_name); - log::info!("Running {} tests", tests.len()); + tracing::info!("Running {} tests", tests.len()); for (test_name, test) in tests.into_iter() { let cs = &mut TestConstraintSystem::::new(); @@ -121,7 +121,7 @@ pub fn generate_test_constraints>( ); if result.is_ok() { - log::info!( + tracing::info!( "test {} compiled successfully. Constraint system satisfied: {}", full_test_name, cs.is_satisfied() @@ -131,11 +131,11 @@ pub fn generate_test_constraints>( let output = result?; let output_file = OutputFile::new(&output_file_name); - log::info!("\tWriting output to registers in `{}.out` ...", output_file_name); + tracing::info!("\tWriting output to registers in `{}.out` ...", output_file_name); output_file.write(output_directory, output.bytes()).unwrap(); } else { - log::error!("test {} errored: {}", full_test_name, result.unwrap_err()); + // tracing::error!("test {} errored: {}", full_test_name, result.unwrap_err()); } } diff --git a/leo/commands/build.rs b/leo/commands/build.rs index 38a1cde19d..326cd0d75d 100644 --- a/leo/commands/build.rs +++ b/leo/commands/build.rs @@ -112,7 +112,7 @@ impl CLI for BuildCommand { // Load the state file at `package_name.in` let state_string = StateFile::new(&package_name).read_from(&path)?; - // Log compilation of main file to console + // Log compilation of files to console tracing::info!("program file ({:?})", main_file_path); // Load the program at `main_file_path` diff --git a/leo/commands/deploy.rs b/leo/commands/deploy.rs index 426786e94a..da60d245b6 100644 --- a/leo/commands/deploy.rs +++ b/leo/commands/deploy.rs @@ -56,7 +56,7 @@ impl CLI for DeployCommand { // Get the package name let _package_name = Manifest::try_from(&path)?.get_package_name(); - tracing::info!("Unimplemented - `leo deploy`"); + tracing::error!("Unimplemented - `leo deploy`"); Ok(()) } diff --git a/leo/errors/cli.rs b/leo/errors/cli.rs index 1a66d7ddf8..ad88c22b98 100644 --- a/leo/errors/cli.rs +++ b/leo/errors/cli.rs @@ -107,8 +107,8 @@ pub enum CLIError { VerificationKeyFileError(VerificationKeyFileError), } -macro_rules! impl_T { - (for $($t:tt), +) => { +macro_rules! impl_cli_error { + ($($t:tt), +) => { $(impl From<$t> for CLIError { fn from(error: $t) -> Self { tracing::error!("{}\n", error); @@ -119,7 +119,7 @@ macro_rules! impl_T { } } -impl_T!(for +impl_cli_error!( AddError, BuildError, CircuitFileError, @@ -143,8 +143,8 @@ impl_T!(for SourceDirectoryError, StateFileError, TestError, - VerificationKeyFileError - ZipFileError, + VerificationKeyFileError, + ZipFileError ); impl From for CLIError {