Skip to content

Error logging and examples #242

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

Closed
wants to merge 32 commits into from
Closed

Error logging and examples #242

wants to merge 32 commits into from

Conversation

rimutaka
Copy link
Contributor

@rimutaka rimutaka commented Jul 22, 2020

Issue #, if available: #241, #232, #216, #215

Description of changes:

  1. Replaced tracing with log
  2. Added error logging to
  3. Added an extensive example with error logging options
  4. Removed simulated feature from Cargo.toml
  5. Added dev-dependencies to Cargo.toml
  6. Updated crates via cargo update
  7. Added readme.md to /lambda/examples/
  8. Removed some commented-out code at the end of client.rs
  9. Added comments to hello.rs and hello-without-macros.rs

Please, review the code carefully. I am new to Rust. Your comments and corrections are very welcome.

Important

I was unable to test this line from client.rs:

error!("Got error serving connection {}", e);

By submitting this pull request

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I confirm that I've made a best effort attempt to update all relevant documentation.

@rimutaka rimutaka marked this pull request as ready for review July 22, 2020 11:27
@davidbarsky
Copy link
Contributor

Thanks for opening this PR! A decent chunk of these changes have been landed in this branch. Can you rebase your README.md changes + examples atop of this branch?

Some of the comments are on your fork, by way, not on this PR. Can you comment on this PR in the future?

@rimutaka
Copy link
Contributor Author

@davidbarsky, I'll rebase once we have a resolution on tracing.

Copy link
Contributor

@Veetaha Veetaha left a comment

Choose a reason for hiding this comment

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

LGTM with a couple of points otherwise 👍

# Conflicts resolved in favour of davidbarsky/update-readme:
#	Cargo.lock
#	lambda/Cargo.toml
#	lambda/examples/README.md
#	lambda/examples/basic.rs
#	lambda/examples/error-handling.rs
#	lambda/src/client.rs
#	lambda/src/lib.rs
…master`.

* origin/davidbarsky/update-readme:
  Removed unnecessary + Sync on handler's future
  Added docs and missing _vars to reduce warnings
  Enforced Send+Sync for http Handler impl.
  Added some tracing!() to lib.rs.
  Fixed "Process exited" error in lib.rs.
  client.rs formatting fix
  Log panic as Debug+Display, improved examples
  Added err logging to lib.rs, consolidated examples
  Added error handling for #241, interim, broken.
  disable time on `tracing_subscriber`
  Add log and tracing examples; fix `tracing` dependency features.
  Create a reusable runtime struct + builder
  Cleanup docs; handle panics in lambda functions correctly.
  Add Cargo.lock to gitignore; whoops.
  don't depend on serde_derive directly
  Replace `genawaiter` with `async-stream` (#240)
  reorg
@bahildebrand
Copy link
Contributor

This looks good to me, but I wanted to be sure we addressed everything in previous reviews. @rimutaka @davidbarsky it appears there was some disagreement about removing tracing, but as far as I can tell tracing is still present. There was mention of a discussion in your fork, but I can't find it. Was this issue solved out of band? If so I'm comfortable approving and merging.

@bahildebrand
Copy link
Contributor

I've got a branch up here that fixes all of the merge conflicts. It doesn't look like your branch is set up to accept commits from maintainers, so if I don't here from you in a few days I'll open a PR from that branch.

@coltonweaver
Copy link
Contributor

This has been moved into: #284

The other PR just fixed merge conflicts and whatnot. Thanks for your contribution!

@seanpianka
Copy link
Contributor

Apologies for bumping a closed issue. What is the motivation for migrating from tracing to log?

@rimutaka
Copy link
Contributor Author

rimutaka commented Aug 1, 2021

@seanpianka , the tracing is still there. https://github.com/awslabs/aws-lambda-rust-runtime/blob/master/lambda-runtime/src/lib.rs#L21. There was a discussion that it's overkill, but no action was taken to replace it with log or anything else.

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.

7 participants