-
Notifications
You must be signed in to change notification settings - Fork 8
11. Using the Templating Engine
ferronrsmith edited this page Sep 16, 2014
·
3 revisions
Templates can be used to replace string contents with matching propert names of an object.
Just pass a truthy boolean as the fourth parameter of the getInstance() method to activate the template engine.
Logs must follow a specific format for this engine to recognize templates. These logs will also be coloured once a custom colour is set.
The following example shows you how.
#####Eg.
app.controller('CoreController', ['$scope','$log', function($scope, $log) {
$log = $log.getInstance('CoreController', true, true);
$log.log('Advanced Log Extender Example: Use Case {example}', {example: 6});
}]);######Output:
Dec-08-2013-1:00:47PM >> CONFIG: LOGGING ENABLED GLOBALLY
Dec-08-2013-1:00:47PM::CoreController >> Advanced Log Extender Example: Use Case 6
AngularLogExtender | License: MIT | Made with 💚