Attaches a reporter to a client's 'error' and 'ready' events.
Call it ONLY on a client the package built itself. An injected client
belongs to the caller, and adding an 'error' listener to it would silence
the caller's own handling (ioredis falls back to the console only when no
listener exists). The client is checked structurally at runtime, so the
package's injection facade need not declare on.
With no reporter, the listeners are still attached and drop every event —
the same outcome as a reporter whose logger returns undefined. A built
client therefore never writes to the console, whether or not its owner
supplied a log sink; the owning package's health probe still reports the
outage.
Attaches a reporter to a client's
'error'and'ready'events.Call it ONLY on a client the package built itself. An injected client belongs to the caller, and adding an
'error'listener to it would silence the caller's own handling (ioredisfalls back to the console only when no listener exists). The client is checked structurally at runtime, so the package's injection facade need not declareon.With no
reporter, the listeners are still attached and drop every event — the same outcome as a reporter whose logger returnsundefined. A built client therefore never writes to the console, whether or not its owner supplied a log sink; the owning package's health probe still reports the outage.