@skyux/core
Version:
This library was generated with [Nx](https://nx.dev).
48 lines (47 loc) • 2.1 kB
TypeScript
import { SkyAppFormat } from '../format/app-format';
import { SkyLogDeprecatedArgs } from './types/log-deprecation-args';
import { SkyLogLevel } from './types/log-level';
import * as i0 from "@angular/core";
/**
* Logs information to the console based on the application's log level as
* provided by the `SKY_LOG_LEVEL` injection token. If no token is provided,
* only `error` logs will be shown.
* @internal
*/
export declare class SkyLogService {
#private;
constructor(formatter: SkyAppFormat, applicationLogLevel?: SkyLogLevel);
/**
* Clears previously-logged messages. Primarily used for unit
* testing this service.
*/
static clearPreviousLogs(): void;
/**
* Logs a deprecation warning for a class, property, function, etc. This will
* be logged as a console warning unless a different log level is given in the
* `args` parameter.
* @param name The name of the deprecated class, property, function, etc.
* @param args Information about the deprecation and replacement recommendations.
*/
deprecated(name: string, args?: SkyLogDeprecatedArgs): void;
/**
* Logs a console error if the application's log level is `SkyLogLevel.Error`.
* @param message The error message
* @param params Optional parameters for the error message.
*/
error(message: string, params?: unknown[]): void;
/**
* Logs console information if the application's log level is `SkyLogLevel.Info` or above.
* @param message The informational message
* @param params Optional parameters for the informational message.
*/
info(message: string, params?: unknown[]): void;
/**
* Logs a console warning if the application's log level is `SkyLogLevel.Warn` or above.
* @param message The warning message
* @param params Optional parameters for the warning message.
*/
warn(message: string, params?: unknown[]): void;
static ɵfac: i0.ɵɵFactoryDeclaration<SkyLogService, [null, { optional: true; }]>;
static ɵprov: i0.ɵɵInjectableDeclaration<SkyLogService>;
}