@acoustic-content-sdk/ng-logger

Support package for @acoustic-content-sdk/ng to add logging.

Usage no npm install needed!

<script type="module">
  import acousticContentSdkNgLogger from 'https://cdn.skypack.dev/@acoustic-content-sdk/ng-logger';
</script>

README

npm

API Documentation

Home > @acoustic-content-sdk/ng-logger

ng-logger package

Implementation of a logger service based on ng2-logger.

Classes

Class Description
AcNgLoggingModule Module that provides the a logger factory based on ng2-logger.

Interfaces

Interface Description
Ng2LoggerConfig

Variables

Variable Description
VERSION Version and build number of the package

Home > @acoustic-content-sdk/ng-logger > AcNgLoggingModule

AcNgLoggingModule class

Module that provides the a logger factory based on ng2-logger.

Signature:

export declare class AcNgLoggingModule 

Remarks

You can enable logging for certain logging levels or modules by either providing a config object to the module, setting variables on localStorage or by setting a cookie. Both approaches use the same keys and expect string array serialized in JSON format as a value.

For modules use Ng2LoggerFactory.onlyModules as the key. The value array lists names of the modules or a regular expression string matching the modules. See the documentation for ng2-logger for more details.

For levels use Ng2LoggerFactory.onlyLevel as the key. The value array lists the logging levels, e.g DATA, INFO, WARN or ERROR. See the documentation for ng2-logger for more details.

Properties

Property Modifiers Type Description
VERSION WchSdkVersion Exposes the version information of this module

Methods

Method Modifiers Description
forRoot(aConfig) static Provides the module with default configuration

Home > @acoustic-content-sdk/ng-logger > Ng2LoggerConfig

Ng2LoggerConfig interface

Signature:

export interface Ng2LoggerConfig 

Properties

Property Type Description
onlyLevel ObservableOrT<string[]> Logging configuration for levels https://github.com/darekf77/ng2-logger#selective-debug---global-settings
onlyModules ObservableOrT<string[]> Logging configuration for modules https://github.com/darekf77/ng2-logger#specifying-onlymodules-as-regular-expressions

Home > @acoustic-content-sdk/ng-logger > VERSION

VERSION variable

Version and build number of the package

Signature:

VERSION: {
    version: {
        major: string;
        minor: string;
        patch: string;
        branch: string;
    };
    build: Date;
}

Home > @acoustic-content-sdk/ng-logger > Ng2LoggerConfig > onlyLevel

Ng2LoggerConfig.onlyLevel property

Logging configuration for levels

https://github.com/darekf77/ng2-logger#selective-debug---global-settings

Signature:

onlyLevel?: ObservableOrT<string[]>;

Home > @acoustic-content-sdk/ng-logger > Ng2LoggerConfig > onlyModules

Ng2LoggerConfig.onlyModules property

Logging configuration for modules

https://github.com/darekf77/ng2-logger#specifying-onlymodules-as-regular-expressions

Signature:

onlyModules?: ObservableOrT<string[]>;

Home > @acoustic-content-sdk/ng-logger > AcNgLoggingModule > VERSION

AcNgLoggingModule.VERSION property

Exposes the version information of this module

Signature:

VERSION: WchSdkVersion;

Home > @acoustic-content-sdk/ng-logger > AcNgLoggingModule > forRoot

AcNgLoggingModule.forRoot() method

Provides the module with default configuration

Signature:

static forRoot(aConfig?: Ng2LoggerConfig): ModuleWithProviders;

Parameters

Parameter Type Description
aConfig Ng2LoggerConfig optionally the configuration of the logger

Returns:

ModuleWithProviders

the preconfigured module