UNPKG

@zowe/imperative

Version:
54 lines 1.7 kB
"use strict"; /* * This program and the accompanying materials are made available under the terms of the * Eclipse Public License v2.0 which accompanies this distribution, and is available at * https://www.eclipse.org/legal/epl-v20.html * * SPDX-License-Identifier: EPL-2.0 * * Copyright Contributors to the Zowe Project. * */ Object.defineProperty(exports, "__esModule", { value: true }); exports.ImperativeApi = void 0; class ImperativeApi { constructor(mApis, mConfig, mHome) { this.mApis = mApis; this.mConfig = mConfig; this.mHome = mHome; this.mCustomLoggerMap = {}; } /** * Returns the imperative logger API object * @returns {Logger}: The imperative logger api object. */ get imperativeLogger() { return this.mApis.imperativeLogger; } /** * Returns an imperative app's logger API object * @returns {Logger}: The imperative app's logger api object. */ get appLogger() { return this.mApis.appLogger; } /** * Retrieve a named custom logger that has been configured * @param {string} name - the name of the custom logger * @returns {Logger} the configured logger, if it exists */ additionalLogger(name) { return this.mCustomLoggerMap[name]; } /** * Register a logger with the Imperative API * Mostly used internally in Imperative * @param {string} name - the name of the logger to register * @param {Logger} logger - the logger to store */ addAdditionalLogger(name, logger) { this.mCustomLoggerMap[name] = logger; } } exports.ImperativeApi = ImperativeApi; //# sourceMappingURL=ImperativeApi.js.map