megahertz / electron-log

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

Invalid typings from writeFn #367

Closed clemp6r closed 1 year ago

clemp6r commented 1 year ago

When looking to work with log.transports.console.writeFn I found that the TS typings were invalid.

Actual: https://github.com/megahertz/electron-log/blob/32e5ff8b7fb892b6381aea287d94845360efb3d0/src/index.d.ts#L90

According to what's actually passed (see https://github.com/megahertz/electron-log/blob/32e5ff8b7fb892b6381aea287d94845360efb3d0/src/renderer/lib/transports/console.js#L83), it should be:

writeFn(message: LogMessage): void;

(Or maybe the "renderer" version of console.js should be modified to be consistent with the "main" one.)

megahertz commented 1 year ago

Thanks for the report