Allow custom logging function in aricpp::Client #57
ferchor2003
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
Yeah, I agree it would be convenient allowing the use of a client logger in the library.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In my existing application I already have a custom mechanism to log information. I want to use that in my aricpp application instead of simply writing to std::out.
To that effect I have modified client.h and websocket.h to use a function of my choosing to log events with an added severity parameter.
Hopefully you will find this useful.
websocket.h
Add the LoggingSeverity and pLogInfoFnType definitions and calls to the new logging function:
Where LogCallback is a private member of the class:
I can then log events like in the following, replacing std::cout:
client.h
Add the ability to pass the custom logging function as a parameter to the constructor:
Application code
Beta Was this translation helpful? Give feedback.
All reactions