UNPKG

1.38 kBTypeScriptView Raw
1import * as yargs from 'yargs';
2import { LogLevel } from '../common/logger';
3import { CliContribution } from './cli';
4import { Event, Emitter } from '../common/event';
5/** Maps logger names to log levels. */
6export interface LogLevels {
7 [key: string]: LogLevel;
8}
9/**
10 * Parses command line switches related to log levels, then watches the log
11 * levels file (if specified) for changes. This is the source of truth for
12 * what the log level per logger should be.
13 */
14export declare class LogLevelCliContribution implements CliContribution {
15 protected _logLevels: LogLevels;
16 /**
17 * Log level to use for loggers not specified in `logLevels`.
18 */
19 protected _defaultLogLevel: LogLevel;
20 protected logConfigChangedEvent: Emitter<void>;
21 get defaultLogLevel(): LogLevel;
22 get logLevels(): LogLevels;
23 configure(conf: yargs.Argv): void;
24 setArguments(args: yargs.Arguments): Promise<void>;
25 protected watchLogConfigFile(filename: string): Promise<void>;
26 protected slurpLogConfigFile(filename: string): Promise<void>;
27 get onLogConfigChanged(): Event<void>;
28 logLevelFor(loggerName: string): LogLevel;
29 /**
30 * Converts the string to a `LogLevel`. Throws an error if invalid.
31 */
32 protected readLogLevelString(levelStr: string, errMessagePrefix: string): LogLevel;
33}
34//# sourceMappingURL=logger-cli-contribution.d.ts.map
\No newline at end of file