Skip to content

Allow custom loggers #285

Answered by enisdenjo
jamesmeneghello asked this question in Q&A
Dec 17, 2021 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

Those console logs were added to put emphasis on uncaught internal errors that shouldn't occur.

Still, I understand your point; however, integrating custom logging capabilities is something I am not keen on doing, it is somewhat tedious work - I have to extend the options at appropriate places with logging hooks, decide about log levels, maintain places someone would want to log and make sure to pass helpful arguments, etc.

However, you can hook up your own logging system with precision and decide yourself how/where/what to log by implementing makeServer yourself. Taking inspiration from the "Server usage with ws" recipe, here's a derivative:

import ws from 'ws';
import {
  makeServer,
  G…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@jamesmeneghello
Comment options

Answer selected by jamesmeneghello
Comment options

You must be logged in to vote
3 replies
@enisdenjo
Comment options

@paulruescher
Comment options

@enisdenjo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information about the library is requested
3 participants
Converted from issue

This discussion was converted from issue #284 on December 18, 2021 14:16.