Closed azulay7 closed 7 years ago
I've done it ofcourse. the error is at run time. when I get to the service Constructor it didn't yet upload 'log4javascript' library.
Ok.. this iw weird I succeed by changing the row from import {Logger} from 'log4javascript'; to import * as log from 'log4javascript';
this is suck .
thank you for the answer.
The problem is that log4javascript is not ready for ES6 imports (which is what TS uses). That library is like a year and a half old, so the author would need to update it to "modern tools".
Hi, I really like your project, clean and neat. I'm trying to build a log service of my own that usses 'log4javascript'; I added this library to vendor.ts and to my service. but when I run it, I get an error: log4javascript is not defined.
Here is my code:
import { Injectable } from '@angular/core'; import {Logger} from 'log4javascript';
@Injectable() export class MyLoggerService { log:any;
constructor() {
}
info(message){ this.log.info(message); } }
Thank you in advance :) Amit