-
Notifications
You must be signed in to change notification settings - Fork 9
implement logger facility and support its' overriding; #19
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a robust solution. If we want to log error anywhere else this code will be copied. Also, this approach adds a new constructor which is not great either.
This should be done via registering the logger instance once and using it anywhere we want to log something. You should define an appropriate logger interface, define a dummy one (dumps to stdout), and provide free function to register custom (something like stream_client::set_logger(...)
). This function may accept a logger instance or just a callback function and construct an instance from it. Also, the logger interface should support log levels.
Another approach would be to propagate such errors outside and give the user ability to process them (they may log, count or take action upon them). |
update by comments in new patchset |
This comment was marked as resolved.
This comment was marked as resolved.
5d1755d
to
edfaf0c
Compare
edfaf0c
to
e4eb4d7
Compare
No description provided.