lwhiteley / AngularLogExtender

AngularLogExtender is an AngularJS module that extends the Angular $log functionality. It uses the native $decorator to push the $log pass its capabilities and provide new functionality such as configuring the $log for different environments such as production and development
MIT License
40 stars 8 forks source link

Log decorators does not work after getInstance is called #50

Open neemanjabu opened 7 years ago

neemanjabu commented 7 years ago

After $newLog = $log.getInstance([name]) is used, log decorators does not work any more. https://docs.angularjs.org/guide/decorators

$provide.decorator('$log', [
    '$delegate',
    function $logDecorator($delegate) {

      var originalWarn = $delegate.warn;
      $delegate.warn = function decoratedWarn(msg) {
        msg = 'Decorated Warn: ' + msg;
        originalWarn.apply($delegate, arguments);
      };

      return $delegate;
    }
  ]);