lambdr icon indicating copy to clipboard operation
lambdr copied to clipboard

Add documentation for debugging

Open mdneuzerling opened this issue 1 year ago • 2 comments

lambdr is set up to use the logger package, and all logs automatically go to Cloudwatch. The package is missing instructions on how to use this functionality, perhaps in the form of a vignette. It would need to cover:

  • logging basics, particularly log levels (many log entries automatically made by lambdr are at the DEBUG level)
  • how to add your own log entries
  • how to view log entries

mdneuzerling avatar Nov 25 '23 10:11 mdneuzerling

This would be a very welcome piece of documentation 🙌🏻

jimgar avatar Apr 07 '24 14:04 jimgar

So this is absolutely still on the agenda, and does deserve its own vignette.

The lambdr package is integrated with the logger package for generating logs. The internals of the package even generate debug-level log entries, eg. https://github.com/mdneuzerling/lambdr/blob/a3cece5b23f9f1b89e95972506f79f9a6eb2ee22/R/start-listening.R#L86

Log entries are automatically captured by AWS CloudWatch. Normally the debug-level entries don't show because the log level isn't high enough but this can be changed by running logger::log_threshold(logger::DEBUG) before running start_lambda. And, of course, the user can log whatever they would like as well.

mdneuzerling avatar Apr 30 '24 10:04 mdneuzerling