1 | import * as Rx from 'rxjs';
|
2 | import { Command, CommandIdentifier } from './command';
|
3 | export declare class Logger {
|
4 | private readonly hide;
|
5 | private readonly raw;
|
6 | private readonly prefixFormat?;
|
7 | private readonly prefixLength;
|
8 | private readonly timestampFormat;
|
9 | |
10 |
|
11 |
|
12 |
|
13 | private lastChar?;
|
14 | |
15 |
|
16 |
|
17 |
|
18 | readonly output: Rx.Subject<{
|
19 | command: Command | undefined;
|
20 | text: string;
|
21 | }>;
|
22 | constructor({ hide, prefixFormat, prefixLength, raw, timestampFormat, }: {
|
23 | |
24 |
|
25 |
|
26 | hide?: CommandIdentifier | CommandIdentifier[];
|
27 | |
28 |
|
29 |
|
30 |
|
31 | raw?: boolean;
|
32 | |
33 |
|
34 |
|
35 |
|
36 | prefixFormat?: string;
|
37 | |
38 |
|
39 |
|
40 | prefixLength?: number;
|
41 | |
42 |
|
43 |
|
44 |
|
45 | timestampFormat?: string;
|
46 | });
|
47 | private shortenText;
|
48 | private getPrefixesFor;
|
49 | getPrefix(command: Command): string;
|
50 | colorText(command: Command, text: string): string;
|
51 | /**
|
52 | * Logs an event for a command (e.g. start, stop).
|
53 | *
|
54 | * If raw mode is on, then nothing is logged.
|
55 | */
|
56 | logCommandEvent(text: string, command: Command): void;
|
57 | logCommandText(text: string, command: Command): void;
|
58 | /**
|
59 | * Logs a global event (e.g. sending signals to processes).
|
60 | *
|
61 | * If raw mode is on, then nothing is logged.
|
62 | */
|
63 | logGlobalEvent(text: string): void;
|
64 | /**
|
65 | * Logs a table from an input object array, like `console.table`.
|
66 | *
|
67 | * Each row is a single input item, and they are presented in the input order.
|
68 | */
|
69 | logTable(tableContents: Record<string, unknown>[]): void;
|
70 | log(prefix: string, text: string, command?: Command): void;
|
71 | emit(command: Command | undefined, text: string): void;
|
72 | }
|