Is there a way to create a custom global logging function in Angular 2 TypeScript project that can be used instead of console.log for services and components?
I envision the function looking like this:
mylogger.ts
function mylogger(msg){
console.log(msg);
};
user.service.ts
import 'commons/mylogger';
export class UserService{
loadUserData(){
mylogger('About to retrieve data');
return 'data';
};
};