Neptune: Planet or Myth?

    @halfdevil/ngx-logger

    2.0.5 • Public • Published

    NgxLogging

    It is a library of Angular that allows you to Log the data to the Server.

    Getting started

    Step 1: Install @halfdevil/ngx-logger:

    NPM

    npm i @halfdevil/ngx-logger

    Step 2: Import the NgxLoggingService:

    import { NgxLoggingService } from '@halfdevil/ngx-logger';
    
    @Component({
      selector: 'app-init',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.scss']
    })
    export class AppComponent {
      constructor(private logger: NgxLoggingService) {
        this.logger.API_URL = "YOUR API URL";
        this.logger.Request_Type = "GET For Get Request, POST For Post Request";
    
        // Log Level: Info
        this.logger.info("Your Message", [Optional Params]);
    
        // Log Level: Debug
        this.logger.debug("Your Message", [Optional Params]);
    
        // Log Level: Warn
        this.logger.warn("Your Message", [Optional Params]);
    
        // Log Level: Error
        this.logger.error("Your Message", [Optional Params]);
    
        // Log Level: Fatal
        this.logger.fatal("Your Message", [Optional Params]);
    
        // Log Level: All
        this.logger.log("Your Message", [Optional Params]);
    
        // Want To Turn Off Logs
        this.logger.level = this.logger.LogLevel.Off;
    
        // Optional
        this.logger.ShowAPIOutput = true; // Shows Output (Success, Error) in Console Log Not to be Used In Production.
        this.logger.logWithDate = true; // If you want to also include date of log.
      }
    }

    Keywords

    none

    Install

    npm i @halfdevil/ngx-logger

    DownloadsWeekly Downloads

    1

    Version

    2.0.5

    License

    none

    Unpacked Size

    11.8 kB

    Total Files

    14

    Last publish

    Collaborators

    • halfdevil