Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

Logging

Logging

1,176 0
Logging is another essential tool of every developer. Logging provides the developer with logs of the application flow and state, which are essential information used in solving bugs.

One can argue that a debugger is more powerful and useful than logging, and bugs should never make it to deployment. The latter statement is too idealistic, since not all input to the application can be controlled perfectly, and unexpected input or steps might cause unexpected application state. Logging can help us track the steps the users take, allowing us to (hopefully) reproduce the bug, and exterminate it. A program log is also a more friendly way for users to report bug, as compared to asking the user to 'try to remember what they did before the bug occur'.

I could create my own logging utility, but I am not so confident that I can invent a better wheel. Instead, I will write a small simple abstraction logging layer over an existing 3rd party logging utility. Why another layer of indirection? Quite simply to decouple the 3rd party logging utility from the application, in the event that I wish to change to another 3rd party logging utility.

I searched around, and between the Microsoft Building Block's Logging Framework and log4net, log4net seems more 'interesting'.

Granted though, log4net is probably overkilled, when a simple file logging class could do...

Discussion

Loading comments...