megahertz / electron-log

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

How to check when log.error() is called #396

Closed ghost closed 5 months ago

ghost commented 5 months ago

Hi!

I was trying to handle log process to file. For case log file have been block permission (write, modify,..), function log.error() will not update this file contents and not emit error.

How i can check this process? Or check when any log.error() function have been call in application?. Thanks!

image

megahertz commented 5 months ago

Under the hood, it calls the console transport directly. The only way to handle such a case outside is to overwrite log.transports.console.writeFn function.

ghost commented 5 months ago

Under the hood, it calls the console transport directly. The only way to handle such a case outside is to overwrite log.transports.console.writeFn function.

It is useful for me. Thank you for your reply!