Reputation: 3002
I want to disable all the logs while building production build. I am using ember 2.5 latest version.
Upvotes: 1
Views: 1238
Reputation: 1590
What I can think of for a quick solution is the following.
adding the following, to something like app.js or an initializer maybe
if(config.environment === 'production'){
Ember.Logger.log = function(){}
}
and maybe going a bit further by adding an option to your config/environment.
var ENV = {
logging_active: false,
...,
...,
}
if (environment === 'development') {
ENV.logging_active = true
}
and then in your app
if(!config.logging_active){
Ember.Logger.log = function(){}
}
Upvotes: 2