How to use the @zowe/imperative.Imperative function in @zowe/imperative

To help you get started, we’ve selected a few @zowe/imperative examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zowe / imperative / __tests__ / src / packages / imperative / plugins / test_plugins / normal_plugin_misc / lib / sample-plugin / cmd / imperative-logging / imperativeLogging.handler.js View on Github external
return __awaiter(this, void 0, void 0, function* () {
            var aLogger = T.Imperative.api.appLogger;
            aLogger.debug(`Log message from test plugin: DEBUG: ${params.arguments.test}`);
            aLogger.info(`Log message from test plugin: INFO: ${params.arguments.test}`);
            aLogger.warn(`Log message from test plugin: WARN: ${params.arguments.test}`);
            aLogger.error(`Log message from test plugin: ERROR: ${params.arguments.test}`);

            var iLogger = T.Imperative.api.imperativeLogger;
            iLogger.debug(`Log message from test plugin: DEBUG: ${params.arguments.test}`);
            iLogger.info(`Log message from test plugin: INFO: ${params.arguments.test}`);
            iLogger.warn(`Log message from test plugin: WARN: ${params.arguments.test}`);
            iLogger.error(`Log message from test plugin: ERROR: ${params.arguments.test}`);

            var config = T.ImperativeConfig.instance.loadedConfig;
            params.response.console.log(`${params.arguments.test}: Messages logged successfully to the following locations`);
            params.response.console.log(path.join(config.defaultHome, "imperative", "logs", "imperative.log"));
            params.response.console.log(path.join(config.defaultHome, config.name, "logs", config.name + ".log"));
        });
    }
github zowe / imperative / __tests__ / src / packages / imperative / plugins / test_plugins / normal_plugin_misc / lib / sample-plugin / cmd / imperative-apis / imperativeApis.handler.js View on Github external
return __awaiter(this, void 0, void 0, function* () {
            var iApi = T.Imperative.api;

            if (iApi != null) {
                params.response.console.log("Imperative APIs are accessible from the test plugin");
            } else {
                throw new T.ImperativeError({msg: "Imperative APIs are not accessible from the test plugin"});
            }

            if (iApi.imperativeLogger != null) {
                params.response.console.log("Imperative APIs imperativeLogger is accessible from the test plugin");
            } else {
                throw new T.ImperativeError({msg: "Imperative APIs imperativeLogger is not accessible from the test plugin"});
            }

            if (iApi.appLogger != null) {
                params.response.console.log("Imperative APIs appLogger is accessible from the test plugin");
            } else {
github zowe / imperative / __tests__ / src / packages / imperative / plugins / test_plugins / normal_plugin_misc / lib / sample-plugin / cmd / imperative-logging / imperativeLogging.handler.js View on Github external
return __awaiter(this, void 0, void 0, function* () {
            var aLogger = T.Imperative.api.appLogger;
            aLogger.debug(`Log message from test plugin: DEBUG: ${params.arguments.test}`);
            aLogger.info(`Log message from test plugin: INFO: ${params.arguments.test}`);
            aLogger.warn(`Log message from test plugin: WARN: ${params.arguments.test}`);
            aLogger.error(`Log message from test plugin: ERROR: ${params.arguments.test}`);

            var iLogger = T.Imperative.api.imperativeLogger;
            iLogger.debug(`Log message from test plugin: DEBUG: ${params.arguments.test}`);
            iLogger.info(`Log message from test plugin: INFO: ${params.arguments.test}`);
            iLogger.warn(`Log message from test plugin: WARN: ${params.arguments.test}`);
            iLogger.error(`Log message from test plugin: ERROR: ${params.arguments.test}`);

            var config = T.ImperativeConfig.instance.loadedConfig;
            params.response.console.log(`${params.arguments.test}: Messages logged successfully to the following locations`);
            params.response.console.log(path.join(config.defaultHome, "imperative", "logs", "imperative.log"));
            params.response.console.log(path.join(config.defaultHome, config.name, "logs", config.name + ".log"));
        });