My Logger system!

Published July 29, 2006
Advertisement
Yay! My first completed project with some weight in it!

I present to you my very own logging system!
I'm honored if anyone can just test it out and give me some feedback as to what to do with it next. [smile] Currently only supports text files. Oh, and it's C++!

Thanks!

EDIT: version 0.6 is up [smile]
Previous Entry Untitled
Next Entry Progress.
0 likes 2 comments

Comments

Programmer16
It looked really nice and compact, but I had a couple suggestions. First being the addition of variable arguments in your WriteToFile() function or a WriteToFileEx() or something (I use variable arguments a lot for debugging.) Another is a timestamp, which is fairly easy to via _strtime():

char szTime[9];
_strtime(szTime);

file<<"["<<szTime<<"]: "<<text<<"\n";

Timestamps aren't very important, I just find them helpful sometimes (telling how long some things take, when certain errors occur, etc.)

The most important thing though is that you're not flushing your log, which in a bug situation might cause your information to not be written. My advise would be to replace:

file<<text<<"\n";

//with
file<<text<<std::endl; // std::endl adds a newline and flushes the log, so you wouldn't need '\n'.


And, I always have to suggest an HTML log. They can be very helpful in most situations (red text sticks out A LOT.) They can also just be time-saving. For example, when I log that a screenshot was taken, I add a link and since my log automatically opens after the app has finished I just click the link to get my screenshot instead of searching for the folder and then looking through it for my screenshot.

All in all it was very well written and nicely done.
August 04, 2006 07:21 PM
Samsonite
Oh, thank you soo much for testing it out! [smile]
August 06, 2006 04:02 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Goodbye, Gamedev!

1239 views

Untitled

1109 views

Merry Christmas!

1139 views

Untitled

1094 views

Scrolling Demo

1031 views

New PC

911 views

Untitled

853 views

Untitled

887 views

Progress.

915 views
Advertisement