I'm wondering if I should be implementing two versions of core.syslog, one that takes a buffer, one that takes a String, and then dispatching between them like fs does. Is that the right way? I thought I'd be able to find out if the msg argument was a Buffer in C++, and do it there, but I'm not successfully figuring out how to do that.
The syslog() core function is most likely going to get called with a String mostly, but in the case of a writeable stream, it will be a Buffer. I could ask the stream base to not convert strings to buffers, then I could get either String or Buffer and treat them differently - should I do that?
@bnoordhuis PTAL In particular at core.cc.
I'm wondering if I should be implementing two versions of
core.syslog
, one that takes a buffer, one that takes a String, and then dispatching between them like fs does. Is that the right way? I thought I'd be able to find out if the msg argument was a Buffer in C++, and do it there, but I'm not successfully figuring out how to do that.The
syslog()
core function is most likely going to get called with a String mostly, but in the case of a writeable stream, it will be a Buffer. I could ask the stream base to not convert strings to buffers, then I could get either String or Buffer and treat them differently - should I do that?