Skip to content

Commit 3f24888

Browse files
committed
Take info, warn, and error log levels
1 parent 22287dc commit 3f24888

File tree

4 files changed

+23
-11
lines changed

4 files changed

+23
-11
lines changed

apps/lsp/src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function defaultSettings(): Settings {
8383
colorTheme: 'Dark+'
8484
},
8585
quarto: {
86-
logLevel: LogLevel.Trace,
86+
logLevel: LogLevel.Info,
8787
path: "",
8888
mathjax: {
8989
scale: 1,

apps/lsp/src/logging.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,18 @@ export class LogFunctionLogger extends Disposable implements ILogger {
8383
switch (logLevel) {
8484
case 'trace': return LogLevel.Trace;
8585
case 'debug': return LogLevel.Debug;
86-
case 'off':
86+
case 'info': return LogLevel.Info;
87+
case 'warn': return LogLevel.Warn;
88+
case 'error': return LogLevel.Error;
8789
default:
88-
return LogLevel.Off;
90+
return LogLevel.Warn;
8991
}
9092
}
9193

9294
get level(): LogLevel { return this._logLevel; }
9395

9496
public log(level: LogLevel, message: string, data?: unknown): void {
95-
if (this.level < level) {
97+
if (level < this.level) {
9698
return;
9799
}
98100

@@ -112,9 +114,11 @@ export class LogFunctionLogger extends Disposable implements ILogger {
112114

113115
private toLevelLabel(level: LogLevel): string {
114116
switch (level) {
115-
case LogLevel.Off: return 'off';
116-
case LogLevel.Debug: return 'debug';
117117
case LogLevel.Trace: return 'trace';
118+
case LogLevel.Debug: return 'debug';
119+
case LogLevel.Info: return 'info';
120+
case LogLevel.Warn: return 'warn';
121+
case LogLevel.Error: return 'error';
118122
}
119123
}
120124

apps/lsp/src/service/logging.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,20 @@
1818
* The level of verbosity that the language service logs at.
1919
*/
2020
export enum LogLevel {
21-
/** Disable logging */
22-
Off,
21+
/** Log extremely verbose info about language server operation, such as calls into the file system */
22+
Trace,
2323

2424
/** Log verbose info about language server operation, such as when references are re-computed for a md file. */
2525
Debug,
2626

27-
/** Log extremely verbose info about language server operation, such as calls into the file system */
28-
Trace,
27+
/** Informational messages that highlight the progress of the application at coarse-grained level. */
28+
Info,
29+
30+
/** Potentially harmful situations which still allow the application to continue running. */
31+
Warn,
32+
33+
/** Error events that might still allow the application to continue running. */
34+
Error,
2935
}
3036

3137
/**

apps/vscode/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,9 @@
13141314
"enum": [
13151315
"trace",
13161316
"debug",
1317-
"off"
1317+
"info",
1318+
"warn",
1319+
"error"
13181320
],
13191321
"markdownDescription": "Log level for the Quarto language server."
13201322
}

0 commit comments

Comments
 (0)