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

feat: logging #2305

Closed
wants to merge 1 commit into from
Closed

feat: logging #2305

wants to merge 1 commit into from

Conversation

joske
Copy link
Contributor

@joske joske commented Jan 16, 2024

Using println! for logging is annoying when snarkVM is used as library (like snarkOS).

  • Replace println and friends with logging
  • install simple_logger impl in binaries where appropriate

Draft, to be revisited after mainnet.

@@ -36,7 +38,7 @@ impl<N: Network> Package<N> {
let _locator = Locator::<N>::from_str(&format!("{program_id}/{function_name}"))?;

#[cfg(feature = "aleo-cli")]
println!("🚀 Running '{}'...\n", _locator.to_string().bold());
trace!("🚀 Running '{}'...\n", _locator.to_string().bold());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is very wrong. the CLI does not use tracing!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has major downstream implications for leo

@@ -400,7 +404,8 @@ mod tests {
check_true_sub_false_with_false(Mode::Public, Mode::Private, Mode::Constant, 0, 0, 2, 2);
check_true_sub_false_with_true(Mode::Public, Mode::Private, Mode::Constant, 0, 0, 3, 3); // <- Differs
check_true_sub_true_with_false(Mode::Public, Mode::Private, Mode::Constant, 0, 0, 2, 2);
check_true_sub_true_with_true(Mode::Public, Mode::Private, Mode::Constant, 0, 0, 3, 3); // <- Differs
check_true_sub_true_with_true(Mode::Public, Mode::Private, Mode::Constant, 0, 0, 3, 3);
// <- Differs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

incorrect changes here, please fix, thanks!

@@ -105,21 +106,21 @@ impl<F: PrimeField> LinearCombination<F> {
// Enforce property 2.
// Note: This branch is triggered if ANY term is not (zero or one).
if self.terms.iter().any(|(v, _)| !(v.value().is_zero() || v.value().is_one())) {
eprintln!("Property 2 of the `Boolean` type was violated in {self}");
warn!("Property 2 of the `Boolean` type was violated in {self}");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these warnings are meant to be eprintln

@@ -156,6 +156,9 @@ optional = true
[dependencies.num-traits]
version = "0.2"

[dependencies.log]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove usage of log

@howardwu howardwu closed this Jan 20, 2024
@joske
Copy link
Contributor Author

joske commented Jan 22, 2024

@howardwu was this closed by accident?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants