0.4.14 • Published 6 years ago

ionic-logger-new-test v0.4.14

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Ionic Logger

NPM

Ionic 2+ plugin providing a logger service.

Installation

Make sure you have Ionic and Angular installed.

npm install --save ionic-logger

Check you peer-dependencies warnings after npm install to make sure you are using a version in accordance to your Ionic version.

Import

import { IonicLoggerModule, Logger } from 'ionic-logger';

@NgModule({
  imports: [
    IonicLoggerModule.forRoot({
      docDir: 'MyApp',
      logDir: 'log'
    })
  ],
  providers: [
    Logger
  ]
})
export class AppModule {}

Config

OptionsTypeDescription
docDirstringDocument directory. Defaults to 'ionic-logger'
logDirstringLog directory inside docDir. Defaults to 'log'
logDayFormatstringDay format. Defaults to 'YYYY-MM-DD'
logHourFormatstringHour format. Defaults to 'HH:mm:ss:SSS'
debugbooleanBoolean to enable debug mode. Defaults to false

Example

  • app.component.ts
import { Platform } from 'ionic-angular';
import { Logger } from 'ionic-logger';
import { FileSystemService } from './file-system.service'; // your own service or model that implements ionic-logger FileSystem interface

...

constructor(
  private logger: Logger,
  private platform: Platform
) {
  this.platform.ready().then(() => {

    ...

    this.logger.init(fileSystemService).then((status) => {
      this.logger.debug('[Logger] init: ' + status);
    })
  }
}
0.4.14

6 years ago

0.4.13

6 years ago

0.4.12

6 years ago

0.4.11

6 years ago

0.4.10

6 years ago

0.4.9

6 years ago

0.4.6

6 years ago

0.4.5

6 years ago

0.4.4

6 years ago

0.4.3

6 years ago

0.4.2

6 years ago

0.4.8

6 years ago