I'm using SFML 1.6 to make a game, and sometimes, there will be errors, and when users run the game, I don't want the console showing up, so I redirected stderr
(which SFML uses to log errors apparently) to a file named after the current date. So if there's an error, the users can just check the logs. Now I also want to put the times before each log, so the log file will look like this:
12:34:17 CDT
failed to load image "sprite.png"
12:35:01 CDT
failed to load file "font.ttf"
Is there a way to "tack on" the current time to any output to get the results shown above?
EDIT
I forgot to mention, the SFML library is the one that logs most of the errors, I want to tack on the time as it leaves the application, so to speak. Kind of like a tollbooth, except anything leaving gets a time prepended. I know how to get the time as a string, and I'm not the one calling printf or any other function like it.