Archived

This topic is now archived and is closed to further replies.

Logging?

This topic is 5676 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How deep should i go in my logging? I''ve got a MD3 Loader and I''m logging down to Mesh Level (Mesh Skins and Mesh Vertices) but how deep.. Should I keep the logging on "Failed-To-Open" Level or down on "Vertex-XYZ" Level. The Logfile becomes very huuuge... perhaps i should keep the loggin on "Engine-Initialization" Level.. Any comments, suggestions..?

Share this post


Link to post
Share on other sites
One advice is to rig a logger-class and a set of message types;

here''s an example set of message types:
DBG_COMMENT,
DBG_WARNING,
DBG_ERROR,
DBG_FATAL,

Then you define a set of debug-targets (some examples):
DBG_TO_FILE,
DBG_TO_SCREEN,
DBG_TO_ASSERT,
DBG_TO_NULL,

Internally, you keep a mapping-table between message type and targets (such as DBG_COMMENT messages should be routed to the DBG_TO_NULL target).

Now you log like this:

DBG::Log(DBG_COMMENT, "Hello World");

The neat thing is that different users can have different setups for the routing table; the version I give my artists have the DBG_RESOURCE_ERROR option to screen (pops up a windows dialog), because they''re focussed on getting the art-resources in, and want to know when there''s been a problem. As a programmer, I don''t want that, and instead set the target to DBG_TO_FILE (which dumps it into the log file). Ideally, you want this mapping table stored in the config file.

As for depth you go into; you want to know relevant information... If the position of individual vertices is important to you (maybe you''re comparing your input results to that of the source-file), then by all means log them. In most cases, you''re interested in:

Resources / subsystems loaded
Errors (Warnings, Errors, Fatals)
Special occurences (which changes depending on what you''re testing at the moment).

Allan




Share this post


Link to post
Share on other sites
Log only the major steps. If something goes wrong, decrease the steps to the frame or even vertex level to see exactly when it happend.

Maybe you could do on-screen logging as well if you really need the deatil but don''t want huge log-files. Just like the quake console gave at the beginning of a level. All the data and settings and init calls flying across the screen.

Sander Maréchal
[Lone Wolves Production][Articles][E-mail]

Share this post


Link to post
Share on other sites
Thanks for all the suggestion.
I really like the suggestion __ODIN__ gave me.
I''ll rewrite the log class after the Input class

Share this post


Link to post
Share on other sites