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
If debuglog binds logger.log at the time of module load, debuglog will not be updated to respect setLevel. This causes noisy logs in my application even when running loglevel.getLogger("matrix").disableAll().
Possible fixes
Use logger.log directly instead of debuglog. I don't understand why the library is disabling debuglog based on the local DEBUG constant, but I bet this could be achieved with loglevel's setLevel.
Forfeit line numbers and use a reference to logger.log (e.g. const debuglog = (...args) => logger.log(...args))
Some galaxy-brain Proxy implementation that I wasn't able to achieve (feel like there's a solution here that would keep the current DEBUG behavior and get line numbers with logs)
Please let me know if there's a better way to get these changes moving than filing Github issues – it seems like you have a lot on your plate, and I'd like to help in an effective way.
The text was updated successfully, but these errors were encountered:
Issue
I'm getting noisy logs from this library despite setting
loglevel.getLogger("matrix").disableAll()
.Cause
matrix-js-sdk/src/models/event-timeline-set.ts
Lines 30 to 38 in acbcb46
matrix-js-sdk/src/timeline-window.ts
Line 34 in acbcb46
loglevel
appliessetLevel
by replacing the relevant methods on the logger object: https://github.com/pimterry/loglevel/blob/f0187213feb6495630545a34a3b91633db47a1ee/lib/loglevel.js#L86-L97If
debuglog
bindslogger.log
at the time of module load,debuglog
will not be updated to respectsetLevel
. This causes noisy logs in my application even when runningloglevel.getLogger("matrix").disableAll()
.Possible fixes
logger.log
directly instead ofdebuglog
. I don't understand why the library is disablingdebuglog
based on the localDEBUG
constant, but I bet this could be achieved withloglevel
'ssetLevel
.logger.log
(e.g.const debuglog = (...args) => logger.log(...args)
)Proxy
implementation that I wasn't able to achieve (feel like there's a solution here that would keep the currentDEBUG
behavior and get line numbers with logs)I've implemented option 1 in my branch: davidisaaclee@9849818
Please let me know if there's a better way to get these changes moving than filing Github issues – it seems like you have a lot on your plate, and I'd like to help in an effective way.
The text was updated successfully, but these errors were encountered: