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

fix .fields() overwriting extra instead of appending #68

Closed Charlie-Hua closed 7 years ago

Charlie-Hua commented 7 years ago

In the original .fields() implementation, extra is assigned to the input d while it should be an extending operation. This should have been caught by the tests but somehow angular.extend() is not used correctly in the tests.

    // incorrect
    expectMessage = angular.extend(message, extra)
    // this extends message, so extra is included in the message

    // correct
    expectMessage = angular.extend({}, message, extra)
    // this does not change message

reference: angular.extend

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 85.227% when pulling 3a84c03cc38d1a91b3d86faa93f3dab063e70ad8 on Charlie-Hua:develop into c33555323e1e95656308760f50ff35c759cd5c84 on ajbrown:develop.

ajbrown commented 7 years ago

@Charlie-Hua Thanks for your contribution!