You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Electron in an ESM environment (which is soon to be available without workaround) together with electron-log. I need to change the location of the log file. However, I cannot prohibit electron-log from creating an empty directory with the name from my package.json. I guess it has something to do with how import works differently from require, because a similar issue had been resolved for the latter. I have created a minimal reproduction of the bug here: https://github.com/raphaelmenges/electron-log-empty-dir-bug.
This is how the Logs directory looks on my Mac after execution:
Hello 👋
I am using Electron in an ESM environment (which is soon to be available without workaround) together with
electron-log
. I need to change the location of the log file. However, I cannot prohibitelectron-log
from creating an empty directory with thename
from mypackage.json
. I guess it has something to do with howimport
works differently fromrequire
, because a similar issue had been resolved for the latter. I have created a minimal reproduction of the bug here: https://github.com/raphaelmenges/electron-log-empty-dir-bug.This is how the
![Screenshot 2023-09-25 at 09 33 11](https://private-user-images.githubusercontent.com/4311739/270264805-b6c4c5ca-04a1-40a8-9be8-fe3348a02de3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1OTAzMjIsIm5iZiI6MTczOTU5MDAyMiwicGF0aCI6Ii80MzExNzM5LzI3MDI2NDgwNS1iNmM0YzVjYS0wNGExLTQwYTgtOWJlOC1mZTMzNDhhMDJkZTMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTVUMDMyNzAyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MGExYzhmNTBjYzZkZGQ2YWM3MjYwZjRiMGY2YTc5MDQ5MjJjZGU1NDk2ZjQzYzM2NDVlYjAwOTI1N2FjYzdkNyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.gcvxvr0nY8bMZc9O7-Zo2JMx0Gnu2_27uljdBqXiHhM)
Logs
directory looks on my Mac after execution:Here is where I create the app:
https://github.com/raphaelmenges/electron-log-empty-dir-bug/blob/main/packages/main/src/app.ts
Here is where I setup the log:
https://github.com/raphaelmenges/electron-log-empty-dir-bug/blob/main/packages/main/src/log.ts
Here is where I combine both:
https://github.com/raphaelmenges/electron-log-empty-dir-bug/blob/main/packages/main/src/index.ts
It does not hurt the UX but feels weird to have an empty directory created with no use!
The text was updated successfully, but these errors were encountered: