rhelgeby / smprojectbase

Automatically exported from code.google.com/p/smprojectbase
0 stars 0 forks source link

Logging categories #70

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Look at this function:

LogMgr_Print(Module:module, LogTypes:logtype, const String:description[], const 
String:text[], any:...)

Replace description with a new enum for logging categories. A lot of modules 
will log info about loading and other events. With many modules this will 
result in log spam, but the log messages itself should still not be removed 
from the code. They're still useful in some cases.

By defining categories, these can be disabled (per module) so the server admins 
can decide exactly what kind of messages to log, in addition to the log type.

The category enum should be possible to expand by developers with their own 
custom categories. For this base project we could have these to start with:

* Loading       - Any kind of loading message (file, translations, etc.)
* Validation    - Something is being validated. This will usually be a error 
log type.
* Info          - Generic info message.
* ...           - Other custom categories (game/module events, etc.)

These categories will need predefined phrases in the translations, and they 
should be short phrases.

The log manager will need to keep a boolean log filter matrix to look up in 
when logging messages, a simple API, and console commands to modify the filter 
(admins should be able to do this in-game too, not just in the server console).

Original issue reported on code.google.com by richard.helgeby@gmail.com on 27 Apr 2011 at 1:42