@acoustic-content-sdk/ng-logger 中文文档教程

发布于 4年前 浏览 18 更新于 3年前

npm

API Documentation

主页 > @acoustic-content-sdk/ng-logger

ng-logger package

基于ng2-记录器

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

提供基于 ng2-logger

签名:

export declare class AcNgLoggingModule 

Remarks

您可以通过向模块提供配置对象、在 localStorage 或通过设置 cookie 。 这两种方法都使用相同的键,并期望以 JSON 格式 序列化的字符串数组作为值。

对于模块,使用 Ng2LoggerFactory.onlyModules 作为键。 值数组列出模块的名称或与模块匹配的正则表达式字符串。 有关详细信息,请参阅 ng2-logger 的文档。

对于级别,使用 Ng2LoggerFactory.onlyLevel 作为键。 值数组列出日志记录级别,例如 DATAINFOWARN 或<代码>错误。 有关详细信息,请参阅 ng2-logger 的文档。

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

首页; @acoustic-content-sdk/ng-logger > Ng2LoggerConfig

Ng2LoggerConfig interface

Signature:

export interface Ng2LoggerConfig 

Properties

Property Type Description
onlyLevel ObservableOrT&lt;string[]&gt; Logging configuration for levels https://github.com/darekf77/ng2-logger#selective-debug---global-settings
onlyModules ObservableOrT&lt;string[]&gt; 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;
}

首页 > @acoustic-content-sdk/ng-logger > Ng2LoggerConfig > onlyLevel

Ng2LoggerConfig.onlyLevel property

级别的日志记录配置

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

签名:

onlyLevel?: ObservableOrT<string[]>;

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

Ng2LoggerConfig.onlyModules property

模块的日志配置

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

签名:

onlyModules?: ObservableOrT<string[]>;

首页; @acoustic-content-sdk/ng-logger > AcNgLoggingModule > VERSION

AcNgLoggingModule.VERSION property

Exposes the version information of this module

Signature:

VERSION: WchSdkVersion;

首页 > @acoustic-content-sdk/ng-logger > AcNgLoggingModule > forRoot

AcNgLoggingModule.forRoot() method

为模块提供默认配置

签名:

static forRoot(aConfig?: Ng2LoggerConfig): ModuleWithProviders;

Parameters

Parameter Type Description
aConfig Ng2LoggerConfig optionally the configuration of the logger

返回:

ModuleWithProviders

预配置模块

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&lt;string[]&gt; Logging configuration for levels https://github.com/darekf77/ng2-logger#selective-debug---global-settings
onlyModules ObservableOrT&lt;string[]&gt; 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

更多

友情链接

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文