3 ms·
I have often written my own logging implementations for similar reasons. I think it is pretty difficult to turn the set of features into a generic library becau
by jandrewrogers 3y ago
I have often written my own logging implementations for similar reasons. I think it is pretty difficult to turn the set of features into a generic library because it necessarily is opinionated about multiple aspects of the software architecture that uses it.
Not all formatting is amenable to being pushed to another thread without introducing undesirable concurrency concerns.
- mgaunard 3y agoThat's why you need an extensible serialization system: to handle data that isn't copyable or whose copies would require memory allocation.
- linkdd 3y agoWhich my library propose with the very simple concept `as_string_trait` that requires the presence of a method `std::string as_string() const`. It's good enough for 100% of my use cases.
- mgaunard 3y agowell clearly that doesn't work, you can't pass it a buffer to write into. This necessary allocates, and I guess it formats on the hot path too.
- linkdd 3y agoWhich is good for 100% of my use cases, since I don't deal with real time systems, or performance intensive applications, or memory/allocation constrained environments. No need to use the bazooka to kill an ant.