Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@progress-chef/interact-logger

Package Overview
Dependencies
Maintainers
9
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@progress-chef/interact-logger

Interact logger library created using [ngx-logger](https://github.com/dbfannin/ngx-logger). It uses most of features of ngx-logger and customizes some of feature based on requirement.

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
9
Weekly downloads
 
Created
Source

Logger

Interact logger library created using ngx-logger. It uses most of features of ngx-logger and customizes some of feature based on requirement.

Build

Run ng build logger to build the project. The build artifacts will be stored in the dist/ directory.

Publishing

After building your library with ng build logger, go to the dist folder cd dist/logger and run yarn publish.

How to use this library?

  1. Install interact-logger.

    yarn add interact-logger
    
  2. Import InteractLoggerModule in app.module.ts.

    import { InteractLoggerModule } from 'interact-logger';
    
    @NgModule({
    imports: [
    ...
        InteractLoggerModule
    ],
    ...
    })
    
  3. Following is the sample code snippet of app.component.ts which can be added in any domain app or MFE app to use this logger:

    import { Component, OnInit } from '@angular/core';
    import { NGXLogger, NgxLoggerLevel } from 'interact-logger';
    
    @Component({
    selector: 'app-root',
    templateUrl: './app.component.html'
    })
    export class AppComponent implements OnInit {
    title = 'shell';
    
    logConfig: any = {
        domain: '<MFE_NAME>',
        disableFileDetails: true,
        level: NgxLoggerLevel.DEBUG,
        serverLogLevel: NgxLoggerLevel.DEBUG,
        serverLoggingUrl: '<SERVER_LOG_COLLECTOR_URL>',
        customHttpHeaders: new HttpHeaders({ Authorization: '<token> }),
        timestampFormat: 'full',
        colorScheme: ['purple', 'teal', 'gray', 'gray', 'red', 'red', 'red'],
    };
    
    
    constructor(private logger: NGXLogger) {
        this.logger.updateConfig(this.logConfig);
    }
    
    ngOnInit() {
        this.logger.debug('DEBUG LOG: debug log');
        this.logger.info('INFO LOG: Normal info logs');
        this.logger.log('LOG: Normal info logs');
    
        this.logger.warn('WARNING LOG: Multiple', 'Argument', 'support');
        this.logger.error('ERROR LOG: Your log message goes here');
        this.logger.fatal('FATAL LOG: **** FATAL LOG ******');
    }
    }
    

NOTE: Please refer ngx-logger to get more information on configuration and customization options for this logger.

FAQs

Package last updated on 24 Nov 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc