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

log4cl-extras #22

Open
utterances-bot opened this issue Jul 21, 2020 · 2 comments
Open

log4cl-extras #22

utterances-bot opened this issue Jul 21, 2020 · 2 comments

Comments

@utterances-bot
Copy link

log4cl-extras

https://40ants.com/lisp-project-of-the-day/2020/07/0136-log4cl-extras.html

Copy link
Contributor

Nice!

a macro to capture unhandled errors along with their tracebacks.

this looks like what Sentry does, for which we have a CL client: https://github.com/mmontone/cl-sentry-client (with the benefit of having a web dashboard and email notifications)

@svetlyak40wt
Copy link
Member

Yes, it is similar to sentry, but for Ultralisp I send all logs to Datadog and in case of some error it is possible to find also debug messages, logged before the error (thanks to the "request_id" trick). This way you will get more information about what happened.

Another useful trick, I like, but didn't implement yet is "Crossfinger Logging". Crossfinger logger buffer all log messages and output them only if the error was also logged. Here is the peseudo-code:

(with-crossed-fingers
   (with-log-unhandled
       (log:debug "Just working")
       (log:info "Everything is fine")
       (log:info "Nothing to worry about")

       (when (< (random 100)
                         10)
           (error "Some shit happened and I need to write to log all messages you see above!"))))

This helps to reduce log size. It will not be cluttered with numerous INFO and DEBUG messages unless something bad happens in this block. Info and debug messages will be written only on error and discarded otherwise.

That is the feature I'd like to add to log4cl-extras myself or to accept as a contribution ;-)

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

No branches or pull requests

3 participants