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.
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.
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?
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.
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.
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.
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.
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.