lundi 15 février 2016

How do I subclass/override Ember.Logger?

I am implementing remote logging ability in my Ember app, where I want to push everything that gets sent to the log console to a remote logging service (e.g. Loggly).

I believe that what I need to do is override Ember.Logger's methods to redirect log output to the remote logging service, but I can't figure out how to do that.

The documentation for Ember.Logger simply states:

Override this to provide more robust logging functionality.

  1. How do I "override this"? I've tried doing Ember.Logger.reopenClass() and it complains with Ember.Logger.reopenClass is not a function.

  2. Where would I do this? In an initializer? In a service? Other?




Aucun commentaire:

Enregistrer un commentaire