megahertz / electron-log

Simple logging module Electron/Node.js/NW.js application. No dependencies. No complicated configuration.
MIT License
1.32k stars 128 forks source link

Optionally add process id to logs #334

Closed uSkizzik closed 1 year ago

uSkizzik commented 1 year ago

Hi! I'm working on an electron application (obviously) and as far as I can see it's not possible to add the process id to the logs.
It would be beneficial for multi-process apps to add this as a formatter option.

I personally need to log PIDs because I use a second elevated process when downloading files in my app so that it can store these files in folders that require elevated permissions. However, when downloading I'd like to log the progress to the same file the main process is logging to and this can be quite confusing... unless the process id is also logged.

megahertz commented 1 year ago

You can set custom variables for that https://github.com/megahertz/electron-log/blob/master/docs/transports/format.md

uSkizzik commented 1 year ago

Ahh mb, I missed that part. Thanks!