UNPKG

ng-zorro-antd-yj

Version:

An enterprise-class UI components based on Ant Design and Angular

150 lines 8.28 kB
/** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ import * as tslib_1 from "tslib"; import { Inject, Injectable, InjectionToken, Optional, SkipSelf } from '@angular/core'; /** @type {?} */ export var NZ_LOGGER_STATE = new InjectionToken('nz-logger-state'); // Whether print the log var LoggerService = /** @class */ (function () { function LoggerService(_loggerState) { this._loggerState = _loggerState; } // tslint:disable-next-line:no-any // tslint:disable-next-line:no-any /** * @param {...?} args * @return {?} */ LoggerService.prototype.log = // tslint:disable-next-line:no-any /** * @param {...?} args * @return {?} */ function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } if (this._loggerState) { console.log.apply(console, tslib_1.__spread(args)); } }; // tslint:disable-next-line:no-any // tslint:disable-next-line:no-any /** * @param {...?} args * @return {?} */ LoggerService.prototype.warn = // tslint:disable-next-line:no-any /** * @param {...?} args * @return {?} */ function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } if (this._loggerState) { console.warn.apply(console, tslib_1.__spread(args)); } }; // tslint:disable-next-line:no-any // tslint:disable-next-line:no-any /** * @param {...?} args * @return {?} */ LoggerService.prototype.error = // tslint:disable-next-line:no-any /** * @param {...?} args * @return {?} */ function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } if (this._loggerState) { console.error.apply(console, tslib_1.__spread(args)); } }; // tslint:disable-next-line:no-any // tslint:disable-next-line:no-any /** * @param {...?} args * @return {?} */ LoggerService.prototype.info = // tslint:disable-next-line:no-any /** * @param {...?} args * @return {?} */ function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } if (this._loggerState) { console.log.apply(console, tslib_1.__spread(args)); } }; // tslint:disable-next-line:no-any // tslint:disable-next-line:no-any /** * @param {...?} args * @return {?} */ LoggerService.prototype.debug = // tslint:disable-next-line:no-any /** * @param {...?} args * @return {?} */ function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } if (this._loggerState) { console.log.apply(console, tslib_1.__spread(['[NG-ZORRO-DEBUG]'], args)); } }; LoggerService.decorators = [ { type: Injectable } ]; /** @nocollapse */ LoggerService.ctorParameters = function () { return [ { type: Boolean, decorators: [{ type: Inject, args: [NZ_LOGGER_STATE,] }] } ]; }; return LoggerService; }()); export { LoggerService }; if (false) { /** * @type {?} * @private */ LoggerService.prototype._loggerState; } /** * @param {?} exist * @param {?} loggerState * @return {?} */ export function LOGGER_SERVICE_PROVIDER_FACTORY(exist, loggerState) { return exist || new LoggerService(loggerState); } /** @type {?} */ export var LOGGER_SERVICE_PROVIDER = { provide: LoggerService, useFactory: LOGGER_SERVICE_PROVIDER_FACTORY, deps: [[new Optional(), new SkipSelf(), LoggerService], NZ_LOGGER_STATE] }; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nZ2VyLnNlcnZpY2UuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZy16b3Jyby1hbnRkLXlqLyIsInNvdXJjZXMiOlsiY29yZS91dGlsL2xvZ2dlci9sb2dnZXIuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLE9BQU8sRUFBRSxNQUFNLEVBQUUsVUFBVSxFQUFFLGNBQWMsRUFBRSxRQUFRLEVBQVksUUFBUSxFQUFFLE1BQU0sZUFBZSxDQUFDOztBQUVqRyxNQUFNLEtBQU8sZUFBZSxHQUFHLElBQUksY0FBYyxDQUFVLGlCQUFpQixDQUFDOztBQUU3RTtJQUVFLHVCQUE2QyxZQUFxQjtRQUFyQixpQkFBWSxHQUFaLFlBQVksQ0FBUztJQUFHLENBQUM7SUFFdEUsa0NBQWtDOzs7Ozs7SUFDbEMsMkJBQUc7Ozs7OztJQUFIO1FBQUksY0FBYzth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