handle the dot between prefix and key automatically#28
Conversation
…add version macros
|
Thanks for the patch! Regarding the macros, what's their use exactly? |
they allow downstream library maintainers to write protective code around API changes so that their library can work on whatever target platform they are being compiled. you might see something like this in downstream code: // newer versions handle the dot automatically
#if STATSD_CLIENT_VERSION_MAJOR >= 2
StatsdClient client{ "127.0.0.1", 8080, "prefix", 20 };
// older versions require you to put the dot manually
#else
StatsdClient client{ "127.0.0.1", 8080, "prefix.", 20 };
#endifthis is probably less useful for a header only library where people are usually vendoring it rather than getting it as an installed package on their platform. but if the preferred way of getting this library is to install a package then the downstream library that depends on it might do like above to make sure whatever version they got from the package manager still worked in their code. no problem if you think its not needed, i dont feel strongly about it, i can happily remove it! |
|
|
||
| // Send a metric explicitly | ||
| client.send("tutu", 4, "c", 2.0f); | ||
| client.send("tutu", 241, "c", 2.0f); |
There was a problem hiding this comment.
this was just because i thought it would be useful to exorcise some bigger numbers some times
fixe #27
this also updates doc strings and README exmaples and since it is API breaking it adds version macros. let me know if i should remove the macros, i know we didnt really discuss them before.