Externalize log level in configuration file.

This commit is contained in:
Alexis Lahouze 2017-07-16 10:51:54 +02:00
parent 877f77babd
commit 9910c0e0d3
2 changed files with 6 additions and 3 deletions

View File

@ -1,3 +1,5 @@
import { Level } from '@nsalaun/ng-logger';
var operationsTmpl = require('./operations/operations.html'); var operationsTmpl = require('./operations/operations.html');
var accountsTmpl = require('./accounts/accounts.html'); var accountsTmpl = require('./accounts/accounts.html');
var schedulerTmpl = require('./scheduler/scheduler.html'); var schedulerTmpl = require('./scheduler/scheduler.html');
@ -26,3 +28,4 @@ export default function AppConfig($routeProvider) {
}; };
export const ApiBaseURL = "http://localhost:8080/api"; export const ApiBaseURL = "http://localhost:8080/api";
export const LogLevel = Level.LOG;

View File

@ -9,18 +9,18 @@ import { BrowserModule } from '@angular/platform-browser';
import { UpgradeModule } from '@angular/upgrade/static'; import { UpgradeModule } from '@angular/upgrade/static';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { NgLoggerModule, Level } from '@nsalaun/ng-logger'; import { NgLoggerModule } from '@nsalaun/ng-logger';
import { RestangularModule } from 'ngx-restangular'; import { RestangularModule } from 'ngx-restangular';
import { AccountModule } from './accounts/account.module'; import { AccountModule } from './accounts/account.module';
import { ApiBaseURL } from './app.config'; import { ApiBaseURL, LogLevel } from './app.config';
@NgModule({ @NgModule({
imports: [ imports: [
BrowserModule, BrowserModule,
UpgradeModule, UpgradeModule,
AccountModule, AccountModule,
NgLoggerModule.forRoot(Level.LOG), NgLoggerModule.forRoot(LogLevel),
RestangularModule.forRoot((RestangularProvider) => { RestangularModule.forRoot((RestangularProvider) => {
RestangularProvider.setBaseUrl(ApiBaseURL); RestangularProvider.setBaseUrl(ApiBaseURL);