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

Future Works < - > Nice to Haves #45

Open ferronrsmith opened 9 years ago

ferronrsmith commented 9 years ago

@lwhiteley feature that you think we be useful and that we should add to the logger.

ferronrsmith commented 9 years ago

app.config(['logExProvider', function(logExProvider) {
    // ignores messages starting with an 's' and ending with a 'e'
    logExProvider.disallow("^s.+e$"); 
}]);

$log.log('something confidential, ignore please');

// >> Dec-08-2013-1:00:47PM >>  ['filtered']
ferronrsmith commented 9 years ago

we can build an ajax hook, that will allow persons to persist data on their back-end

app.config(['logExProvider', function(logExProvider) {
    // ignores messages starting with an 's' and ending with a 'e'
    logExProvider.persist({
         batchSize: 3, // send at intervals to reduce xhr req.  
         interleave : 1000, // instead of using the batchSize an interleave value can be used to determine when messages should be pushed. Increase the value to reduce xhr req
         executor : function (logs) {...},
         adapter : {
            enable : false,
            maxMessages : 15
        }
     }); 
}]);

simple queuing mechanism for keeping track of logs. also include and adapter that if localStorage extension is present it will allow persistence of the logs up to a persistence limit set. the default would be the last 15