ajbrown / angular-loggly-logger

An AngularJS module which sends your $log message to loggly, and provides a service for manually sending messages to loggly.
MIT License
32 stars 49 forks source link

msg.stack is undefined #12

Closed ggregoire closed 9 years ago

ggregoire commented 9 years ago

Hello!

Line 204:

var msg = args.length == 1 ? args[0] : args;

If I log the msg variable:

loggly

Then the stack is not in msg but in msg[0].

I added a quick fix:

if (angular.isDefined(msg.stack || msg[0].stack)) {
    //handling console errors
    if (logger.sendConsoleErrors() === true) {
        sending.message = msg.message || msg[0].message;
        sending.stack = msg.stack || msg[0].stack;
    } else {
        return;
    }
}
ajbrown commented 9 years ago

This is great! :star2: Would you mind opening a pull request with the fix, so you're permanently credited in the history?

ajbrown commented 9 years ago

fixed by #14, thanks! :+1: :+1: