-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot read properties of undefined (reading 'level'” #445
Comments
I need a code sample that reproduces the issue. |
Hi there, I'm encountering an issue with electron-log when trying to set up logging for autoUpdater in my Electron app. The app crashes during the startup phase with the following error:
Steps to Reproduce: 1.Import electron-log into the main process using import log from 'electron-log';.
3.Run the app. Actual Behavior: The app crashes with the error TypeError: Cannot set properties of undefined (setting 'level'). Environment:
Troubleshooting Steps Tried: Verified that electron-log is correctly installed in dependencies. Any guidance or suggestions would be greatly appreciated! |
@leyriel you need to import from |
function consoleTransportFactory(logger) {
return Object.assign(transport, {
format: DEFAULT_FORMAT,
level: 'silly',
transforms: [
addTemplateColors,
format,
formatStyles,
concatFirstStringElements,
maxDepth,
toJSON,
],
useStyles: process.env.FORCE_STYLES,
});其中的[message.level]报错TypeError; Cannot read properties of undefined (reading 'level'”
at Function.writeFn (D:\内网通缓存\陈大荣\国周率软件-保密检查工具(3.0.0)
(2024.11.15.10)-绿色版\保密检查客户端
resources\app,asar\node modules\electron-log\src\main\transportsiconsole.j...51)
at defaultlogger,processinternalErrorFn(D:\内网通缓存\陈大荣\圆周率软件-保密检育
I具(3.0.0)-(2024.11.15.10)-绿色版\保密检查客户端
The text was updated successfully, but these errors were encountered: