Set shared process log level
This commit is contained in:
parent
86d70ec790
commit
e4ff8e1c63
@ -115,6 +115,8 @@ export class Entry extends Command {
|
||||
|
||||
next();
|
||||
});
|
||||
// If we're not running from the binary and we aren't serving the static
|
||||
// pre-built version, use webpack to serve the web files.
|
||||
if (!isCli && !serveStatic) {
|
||||
const webpackConfig = require(path.join(__dirname, "..", "..", "web", "webpack.config.js"));
|
||||
const compiler = require("webpack")(webpackConfig);
|
||||
|
@ -80,17 +80,30 @@ export class SharedProcess {
|
||||
});
|
||||
this.ipcHandler = new StdioIpcHandler(this.activeProcess);
|
||||
this.ipcHandler.once("handshake:hello", () => {
|
||||
let logLevel = LogLevel.Warning;
|
||||
const envLevel = typeof global !== "undefined" && typeof global.process !== "undefined" ? global.process.env.LOG_LEVEL : process.env.LOG_LEVEL;
|
||||
if (envLevel) {
|
||||
switch (envLevel) {
|
||||
case "trace": logLevel = LogLevel.Trace; break;
|
||||
case "debug": logLevel = LogLevel.Debug; break;
|
||||
case "info": logLevel = LogLevel.Info; break;
|
||||
case "warn": logLevel = LogLevel.Warning; break;
|
||||
case "error": logLevel = LogLevel.Error; break;
|
||||
case "critical": logLevel = LogLevel.Critical; break;
|
||||
case "off": logLevel = LogLevel.Off; break;
|
||||
}
|
||||
}
|
||||
const data: {
|
||||
sharedIPCHandle: string;
|
||||
args: ParsedArgs;
|
||||
args: Partial<ParsedArgs>;
|
||||
logLevel: LogLevel;
|
||||
} = {
|
||||
args: {
|
||||
"builtin-extensions-dir": this.builtInExtensionsDir,
|
||||
"user-data-dir": this.userDataDir,
|
||||
"extensions-dir": extensionsDir,
|
||||
} as any,
|
||||
logLevel: 0,
|
||||
},
|
||||
logLevel,
|
||||
sharedIPCHandle: this.socketPath,
|
||||
};
|
||||
this.ipcHandler!.send("handshake:hey there", "", data);
|
||||
|
Loading…
Reference in New Issue
Block a user