Skip to content

How to log arbitrary messages? #43

Open
@acobster

Description

@acobster

The Rollbar PHP SDK (just as an example) allows for logging arbitrary messages to Rollbar:

You can also send Rollbar log-like messages:

<?php
use Rollbar\Rollbar;
use Rollbar\Payload\Level;

Rollbar::log(Level::WARNING, 'could not connect to mysql server');
Rollbar::log(
    Level::INFO, 
    'Here is a message with some additional data',
    array('x' => 10, 'code' => 'blue')
);

This is really useful for certain kinds of remote debugging situations, e.g. when you haven't been able to reproduce a production error yet and need more contextual information.

What I'd like to be able to do in Clojure is something like:

(rollcage/info "some message")
,,,
(rollcage/debug "another message with some context" {:more "context"})

As far as I can tell, though, this would require a change to the API of the core/notify fn, which always expects a Throwable. I think it makes sense to have the Rollcage internals know what to do with Throwable instances when it sees them, but the current API seems to preclude certain valid use-cases of the wider Rollbar API. Or maybe I'm missing something?

Edit: to be clear, I'm happy to submit a PR for widening the API, but I thought it would be best to discuss what that wider API would look first. Thoughts?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions