Socket
Socket
Sign inDemoInstall

ionic-logger

Package Overview
Dependencies
14
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ionic-logger

Ionic 5 plugin providing a logger service.


Version published
Weekly downloads
8
increased by100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Ionic Logger

NPM

Ionic 5 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);
    })
  }
}

Keywords

FAQs

Last updated on 20 Mar 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc