• entries
707
1173
• views
435849

# 3D audio and logging goodness

209 views

Ethereal Darkness Interactive Update

I started coding the engine specific a little while ago (about a half an hour.) Its not as tough as I thought it was going to be. Not much of an update for this at the moment.

Dragonfire Games Update

I spent an extensive amout of time on the logging system for DFT. Before I used:
LogDebugOutput(Text, Type, ...)
.
I was restricted to one filename, one file, and one style sheet.

Here is an example from the new system:
dftClientLog.html
dftSeverLog.html

It uses this css:
style.css

And here is the source for the example:
main.cpp

Its pretty simple, you create as many logs as you want, and then before any code you specify which log you want to use:
dft::HtmlLog::SetCurrentLog(&Log);

For example:
dft::HtmlLog ClientLog;dft::HtmlLog ServerLog;ClientLog.Create("dftClientLog.html", "Dragonfire Games - Client Debug Log", "style.css");ServerLog.Create("dftServerLog.html", "Dragonfire Games - Server Debug Log", "style.css");dft::HtmlLog TextureLog;TextureLog.Create("dftTextureLog.html", "Dragonfire Games - Texture Debug Log", "style.css\nResourceStyles.css");dft::HtmlLog::SetCurrentLog(&ClientLog);dft::HtmlLog::GetCurrentLog()->LogDebugOutput("This is some client output.", dft::DOT_TEXT);dft::HtmlLog::SetCurrentLog(&TextureLog);dft::Texture* pTexture = TexManager.AddResource("GuiSkin", "GuiSkin\\FlamingSkin.png");//assign pTexture somewhere.pTexture = TexManager.AddResource("Player", "Characters\\Asrion.png");//assign pTexture somewhere.dft::HtmlLog::SetCurrentLog(&ServerLog);dft::HtmlLog::GetCurrentLog()->LogDebugOutput("This is some server output.", dft::DOT_TEXT);

Quote:
 Note that \n in the last argument of Create() separates different style sheets.Also note the you poor I.E. users will not get to see the exciting blinking '!' before and after the error text.

Yes, this causes more typing for me, but it really makes the system better, and I can use it in the future without modifying the code.

Yes, this also has unneeded customization, but I feel that if you can modify the style that the debug log appears in, it'll make it easier for you to read, and thus will make it easier for you to spot stuff.

Discussion

Other news

That's very cool. I can't believe I never thought of using HTML log output to increase readability/cool-factor in my own projects. I'm definitely going to have to 'borrow' this idea. [grin]

Its really easy too. If you want, I can let you use my code. It's fairly extensible, so you could separate client/server messages into different files or different output types.

Just let me know and I'll send you the code.

## Create an account

Register a new account