You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add documentation to include angular2-logger in an angular-cli project #79
The current README.md explain how to add angular2-logger to the quickstart project but if one is using angular-cli this is not the way to do it (for example there is no system.config.js).
Adding third party libs are explain in angular-cli readme but there is a few more thing to set it up :)
Here how I did it on my project (after running ng new myproject):
Hi @francisoud thanks for the contribution, I'll take a look at this once angular-cli is out of beta, as of now I've seen a lot of people having issues with it for various different reasons.
Also instead of doing this: this.logger.level = environment.logger.level; in the constructor I'd probably just make the correct logger providers already configured with the level as the config constant instead of just the level.
@langley-agm, thank you!
I never ended up finishing that config logic as I was running into a problem that environment.production wasn't being read as the expected true anywhere, but main.ts.
I'll give the above a try in a new project.
I don't use cli, If anyone has tested this, they believe its the right way to do it and its working in the latest version feel free to make a PR with the added documentation i'll make sure to integrate it soon.
With Angular-CLI version 1.5.0 I'm getting the following error.
ERROR in ./node_modules/angular2-logger/app/core/level.ts
Module build failed: Error: M:\Git\dev\loggerTest\node_modules\angular2-logger\app\core\level.ts is
not part of the compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
Reacted by misha2011, stijn-scorius and Remi Vledder
Activity
langley-agm commentedon Oct 26, 2016
Hi @francisoud thanks for the contribution, I'll take a look at this once angular-cli is out of beta, as of now I've seen a lot of people having issues with it for various different reasons.
Also instead of doing this:
this.logger.level = environment.logger.level;in the constructor I'd probably just make the correct logger providers already configured with the level as the config constant instead of just the level.langley-agm commentedon Nov 4, 2016
@vkniazeu isn't this what you were trying to do?
vkniazeu commentedon Nov 5, 2016
@langley-agm, thank you!
I never ended up finishing that config logic as I was running into a problem that
environment.productionwasn't being read as the expectedtrueanywhere, butmain.ts.I'll give the above a try in a new project.
sleroy commentedon Feb 7, 2017
The documentation worked fine for me except for the isDevMod() function call, method was not found for AngularCLI :
@angular/cli: 1.0.0-beta.30 node: 6.9.4 os: linux x64 @angular/common: 2.4.6 @angular/compiler: 2.4.6 @angular/core: 2.4.6 @angular/forms: 2.4.6 @angular/http: 2.4.6 @angular/platform-browser: 2.4.6 @angular/platform-browser-dynamic: 2.4.6 @angular/router: 3.4.6 @angular/compiler-cli: 2.4.6francisoud commentedon Feb 8, 2017
@sleroy about isDevMode() strange because this method still seems to exist https://angular.io/docs/ts/latest/api/core/index/isDevMode-function.html and I've been using it for 6 months...
dwoznicka commentedon Jun 6, 2017
Seems like a good time to update the documentation on this matter, as cli is out of beta for a while now ;)
coffeenexus commentedon Aug 28, 2017
Any tricks to see the degug logs? I see all levels except those.
langley-agm commentedon Aug 29, 2017
@coffeenexus chrome? make sure you don't have the browser filtering them for you.
langley-agm commentedon Sep 13, 2017
I don't use cli, If anyone has tested this, they believe its the right way to do it and its working in the latest version feel free to make a PR with the added documentation i'll make sure to integrate it soon.
jmfullerton commentedon Dec 13, 2017
With Angular-CLI version 1.5.0 I'm getting the following error.
ERROR in ./node_modules/angular2-logger/app/core/level.ts
Module build failed: Error: M:\Git\dev\loggerTest\node_modules\angular2-logger\app\core\level.ts is
not part of the compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.