Favorite Library: Logging

Pages: 123
Hmm, synchronous, mutex, semaphores, synchronized.... geez, that'll be dead slow.
@rapidcoder
Performance is probably not that important for logging since it's not something that happens very often. My game only logs messages during initialisation and when exiting or if something important happens, so it's not like it's causing the framerate to drop.
Huh, we got to the point, where a hardcore C++ programmer convinces hardcore Java programmer that performance is not that important. :D

Seriously, in games and standalone apps, you're right, but in server-side software, logging can be a bottleneck, especially when you have a huge number of threads.

http://www.grobmeier.de/log4j-2-performance-close-to-insane-20072013.html#.Ue1L4RddVLQ
Not that important for logging.

But you're right, for some programs, it does need to be asynchronous.
closed account (S6k9GNh0)
/me explains that an asyncronous queue can be used to lower wait times.
/me reads rapidcoder's post about log4j.
/me can't help but be pissed since I'm ignored.

Things like logger design isn't even bottlenecked at the binary level, more like the system interface (WinAPI, POSIX) level, based on their implementations and how they're used.
Last edited on
The way you bring a java library into my discussion really irks me.
/me reads rapidcoder's post about log4j.
/me can't help but be pissed since I'm ignored.


How dare he mention something he's familiar with, shocking!
Pretty silly reason to get pissed.
Apparently I have the wrong idea of logging because I don't see how simply outputting set strings and data during initialization and parts of the program cause issues of any kind.
Because IO operations are slow and if you have multiple threads trying to send output all at once you get problems with interruption. One solution to the threading problem is to use a mutex or some other kind of synchronisation method but that slows things down again. If you were to use asynchronous IO, though, it would be a lot faster because then your program would just send output and continue onwards instead of waiting for the IO operation to complete like it normally would.
never heard of logging :]

http://en.wikipedia.org/wiki/Logging

you know its pretty hard to find something that explains logging on the internet, the word is used for so manny things
Last edited on
closed account (S6k9GNh0)
naraku, an over simplification of rapidcoder intercepting every single one of the threads he's pariticipated in to inject Java whether its welcome or not.

Also, you took the reasoning out of context, since rapidcoder has implied that C++ has slow logging (which is absolutely bogus) as compared to Java.
closed account (3qX21hU5)
never heard of logging :]

http://en.wikipedia.org/wiki/Logging

you know its pretty hard to find something that explains logging on the internet, the word is used for so manny things


Here you go devon http://en.wikipedia.org/wiki/Tracing_(software)



naraku, an over simplification of rapidcoder intercepting every single one of the threads he's pariticipated in to inject Java whether its welcome or not.


Is Java programming? It's not like Logging is specific to C++ you know. I see no reason why to get pissed that he brings up Java since he is most familiar with that language.

I don't get it really both Java and C++ as a programming language. It's not like you are forced to know one and only one and you can't talk to anyone that knows the other language.

Also, you took the reasoning out of context, since rapidcoder has implied that C++ has slow logging (which is absolutely bogus) as compared to Java.


Personally I see absolutely no where in this thread that he implied that and you seem to be misunderstanding the things he said.
Last edited on
closed account (S6k9GNh0)
It's not that he brings up Java, it's his attitude that Java is somehow faster than C++ as a language which makes no sense and is fallacious. It's in every discussion he brings up. I don't really care if he doesn't explicitly state it, he sits there and says things like, "Hmm, synchronous, mutex, semaphores, synchronized.... geez, that'll be dead slow. " and "(don't know whether C++ libs do that, but log4j does that extremely well". He implies it all over.

I bring up D whenever language constructs are brought up, not whenever someone wants to know about an optimized library for a certain language (which in this forum, is generally C++). I don't see how it makes sense for me to ask about a favorite logging library in a C++ forum and get recommended a Java library.

If he were to instead discuss the language-independent functionality (or even the C++ ports of log4j such as log4c or log4cpp) then fine. Otherwise, what's the point of bringing up log4j?
Last edited on
Ignoring the trolls, and coming back to the question posed in the thread: Pantheios
http://www.pantheios.org/

Usable on its own. Or hook it up with a Boost.Log or an an ACE diagnostic logging or similar back end, get the unmatched performance of Pantheios coupled with the heavy feature set offered by the logging library.


Ignoring the trolls
I was being a wise ass, so apologies all around.

To the original question, none of my projects have been large enough to require much logging. But I just started looking at Boost.Log and it looks pretty interesting.
I wasn't trolling. I seriously don't see the point of having a library dedicated to logging. Though, like I said, I just use file io and output data, statements, and such to a file during key parts of an application.
closed account (N36fSL3A)
I swear, some people make useless libraries. It isn't that hard to whip up a class for logging, along with a few threads to keep it independent from the main loop. I mean come on now, we have the standard library.
Well, libraries aren't useless. They are made for a reason and are very useful for the thing they are made for. That said, those people, like me, who don't use them usually don't understand the point of it especially if they have methods in place that seem simpler. In truth, some libraries do the hard work under the hood so you just do a few function calls and you are set to go. For example, you would have to do a butt load of code for making your own GUI API or such, while if you get a GUI library you just do their calls and they do all the work for you so you can focus on application development rather than tool development.
closed account (S6k9GNh0)
Fredbill30, I already explained why the standard library isn't adequate for logging out of the box, especially in a threaded environment.

Its not a question of whether a logging library is useful. Just about any major project has a subset of functions that are meant for logging and debugging in general. Logging libraries simply reduce the redundancy instead of having to recreate the wheel.
Last edited on
closed account (N36fSL3A)
In my opinion the more I can do on my own quickly is the most efficient way. I can easily make logging system for my game, the upside is I'll know everything that it does, and it will allow me to add/remove things I want.
closed account (S6k9GNh0)
So you're saying that it's easier for you to write out code and design a logging system that has taken others anywhere from days to years to build up... than to just adapt to a current system?
Last edited on
Pages: 123