|
1 | 1 | import { window as Window, OutputChannel, Progress } from "vscode"; |
2 | | -import { DisposableObject } from "./pure/disposable-object"; |
3 | 2 | import * as fs from "fs-extra"; |
4 | 3 | import * as path from "path"; |
5 | | - |
6 | | -interface LogOptions { |
7 | | - /** If false, don't output a trailing newline for the log entry. Default true. */ |
8 | | - trailingNewline?: boolean; |
9 | | - |
10 | | - /** If specified, add this log entry to the log file at the specified location. */ |
11 | | - additionalLogLocation?: string; |
12 | | -} |
13 | | - |
14 | | -export interface Logger { |
15 | | - /** Writes the given log message, optionally followed by a newline. */ |
16 | | - log(message: string, options?: LogOptions): Promise<void>; |
17 | | - /** |
18 | | - * Reveal this channel in the UI. |
19 | | - * |
20 | | - * @param preserveFocus When `true` the channel will not take focus. |
21 | | - */ |
22 | | - show(preserveFocus?: boolean): void; |
23 | | - |
24 | | - /** |
25 | | - * Remove the log at the specified location |
26 | | - * @param location log to remove |
27 | | - */ |
28 | | - removeAdditionalLogLocation(location: string | undefined): void; |
29 | | -} |
30 | | - |
31 | | -export type ProgressReporter = Progress<{ message: string }>; |
| 4 | +import { Logger, LogOptions } from "../logger"; |
| 5 | +import { DisposableObject } from "../../../pure/disposable-object"; |
32 | 6 |
|
33 | 7 | /** A logger that writes messages to an output channel in the Output tab. */ |
34 | 8 | export class OutputChannelLogger extends DisposableObject implements Logger { |
@@ -128,16 +102,4 @@ class AdditionalLogLocation { |
128 | 102 | } |
129 | 103 | } |
130 | 104 |
|
131 | | -/** The global logger for the extension. */ |
132 | | -export const logger = new OutputChannelLogger("CodeQL Extension Log"); |
133 | | - |
134 | | -/** The logger for messages from the query server. */ |
135 | | -export const queryServerLogger = new OutputChannelLogger("CodeQL Query Server"); |
136 | | - |
137 | | -/** The logger for messages from the language server. */ |
138 | | -export const ideServerLogger = new OutputChannelLogger( |
139 | | - "CodeQL Language Server", |
140 | | -); |
141 | | - |
142 | | -/** The logger for messages from tests. */ |
143 | | -export const testLogger = new OutputChannelLogger("CodeQL Tests"); |
| 105 | +export type ProgressReporter = Progress<{ message: string }>; |
0 commit comments