Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Server crash in /city/anthony/prison



Jan Echternach wrote:
> With llevDebug instead of llevError, you would get the effect of
> wrapping the log message in an if (debug) statement.  But I prefer all
> indications of errors to be logged with llevError, because this allows
> me to trap all errors immediately after they are detected with a simple
> "break LOG if logLevel == llevError" in gdb, provided that I run the
> server "interactively" from gdb.

 The tricky part is the determination of what is a debug message and what is an
actual error message.

 I know some people get a little paranoid when they see any messages getting
logged, so logging lots of messages that are apparantly harmless (ie, the server
doesn't crash or otherwise do bad things) can be confusing for some users.

 In reality, a much more robust logging method should be redone.  Right now,
there are many files or other places that have something like a #define
ATTACK_DEBUG or the like, and if that isn't commented out, you get a bunch of
debug messages about attack.

 A better method, which many other programs do, is differing log output
depending on options.  For example, you could do something like 'crossfire
-attackdebug -imagedebug' and get the debug messages in those areas but not
every place else and not need to recompile before doing so.

 It would also improve readability of the code some to remove all the #ifdefs
that are currently around some of those debug areas because they generate more
output that people generally want.