-
If I have an enum class
I still need to cast it to int32_t while passing as an argument
Is there any way to pass the enum value to the logger directly? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey, if you want to print the underlying value you have to cast it. if you want to print it as string then you have to define a formatter. The underlying value is copied and the conversion will happen by the backend logging thread. For example see this test demonstrating both cases |
Beta Was this translation helpful? Give feedback.
-
Thanks! Writing a formatter for each enum was infeasible because we have hundreds of enums. I ended up writing a few template helpers to accomplish this
I stuck this at the very top of my header that bridges Quill and our code. Now I can pass enums directly without casting |
Beta Was this translation helpful? Give feedback.
Thanks! Writing a formatter for each enum was infeasible because we have hundreds of enums.
I ended up writing a few template helpers to accomplish this