Skip to content

Commit

Permalink
code: Align to changes in the server's logging configuration options
Browse files Browse the repository at this point in the history
  • Loading branch information
alcarney committed Mar 3, 2024
1 parent de188f0 commit 33c7395
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 21 deletions.
100 changes: 80 additions & 20 deletions code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,26 +118,6 @@
},
"description": "A list of additional modules to include in the server's configuration"
},
"esbonio.server.logLevel": {
"scope": "window",
"type": "string",
"default": null,
"enum": [
"debug",
"info",
"error"
],
"description": "The level of log message to show in the log"
},
"esbonio.server.logFilter": {
"scope": "window",
"type": "array",
"default": null,
"items": {
"type": "string"
},
"description": "If set, only messages from the named loggers will be shown"
},
"esbonio.server.pythonPath": {
"scope": "window",
"type": "string",
Expand Down Expand Up @@ -229,6 +209,86 @@
}
}
},
{
"title": "Logging",
"properties": {
"esbonio.logging.level": {
"scope": "window",
"type": "string",
"default": "error",
"enum": [
"critical",
"fatal",
"error",
"warning",
"info",
"debug"
],
"description": "The default level of log message to show in the log"
},
"esbonio.logging.format": {
"scope": "window",
"type": "string",
"default": null,
"description": "The default format string to apply to log messages"
},
"esbonio.logging.filepath": {
"scope": "window",
"type": "string",
"default": null,
"description": "If set, record log messages in the given filepath (path is relative to the server's working directory)."
},
"esbonio.logging.stderr": {
"scope": "window",
"type": "boolean",
"default": true,
"description": "If set, print log messages to stderr"
},
"esbonio.logging.window": {
"scope": "window",
"type": "boolean",
"default": false,
"description": "If set, send log messages as window/logMessage notifications"
},
"esbonio.logging.config": {
"scope": "window",
"type": "object",
"patternProperties": {
".*": {
"type": "object",
"properties": {
"level": {
"type": "string",
"enum": [
"critical",
"fatal",
"error",
"warning",
"info",
"debug"
],
"description": "The level of log message to show in the log for this logger"
},
"filepath": {
"type": "string",
"description": "If set, log messages from this logger to the given file (path is relative to server working directory)."
},
"stderr": {
"type": "boolean",
"description": "If set, print messages from this logger to stderr."
},
"window": {
"type": "boolean",
"description": "If set, send messages from this logger as window/logMessage notifications."
}
}
}
},
"default": {},
"description": "Low level logging configuration settings to apply to individual loggers"
}
}
},
{
"title": "Developer Options",
"properties": {
Expand Down
2 changes: 1 addition & 1 deletion code/src/node/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let logger: OutputChannelLogger

export async function activate(context: vscode.ExtensionContext) {
let channel = vscode.window.createOutputChannel("Esbonio", "esbonio-log-output")
let logLevel = vscode.workspace.getConfiguration('esbonio').get<string>('server.logLevel')
let logLevel = vscode.workspace.getConfiguration('esbonio').get<string>('logging.level')

logger = new OutputChannelLogger(channel, logLevel)

Expand Down

0 comments on commit 33c7395

Please sign in to comment.