aws-cli-util-logger
Version:
Simple logging library for use with AWS CLI utilities
64 lines (63 loc) • 1.49 kB
TypeScript
export interface AwsCliUtilLoggerOptions {
/**
* Name of the npm package.
*
* @example
* "aws-sso-creds-helper"
*/
packageName: string;
/**
* Name of the bin command.
*
* @example
* "ssocreds"
*/
binCommand?: string;
/**
* Enables verbose logging.
*
* @default
* false
*/
verbose?: boolean;
/**
* When true, disables **ALL** logging output.
*
* @default
* false
*/
disabled?: boolean;
/**
* Debug flag for your CLI.
*
* @default
* "--debug"
*/
debugFlag?: string;
}
export declare class AwsCliUtilLogger {
name: string;
binCommand?: string;
debugFlag: string;
disabled: boolean;
LOG_PREFIX: string;
SEPARATOR: string;
verbose: boolean;
constructor({ packageName, disabled, verbose, binCommand, debugFlag, }: AwsCliUtilLoggerOptions);
success(...messages: string[]): void;
info(...messages: string[]): void;
warn(...messages: string[]): void;
error(...messages: string[]): void;
debug(...messages: string[]): void;
log(...messages: string[]): void;
setVerbose(level: boolean): void;
isVerbose(): boolean;
disable(): void;
enable(): void;
handleError: (e: Error | unknown, debug?: boolean) => void;
logSystemInfo(profile: string): Promise<void>;
private formatMessages;
private print;
private getCliVersion;
private getCliConfig;
}