OXPs can now contain
logcontrol.plist files for their own log entries. They cannot override settings defined in the built-in logcontrol.plist (but you can still do that with loose files in AddOns folders). In fact, they cannot touch
hierarchies from the built-in file; for example, they can’t set
script.myScript
because the built-in one has entries beginning with
script.
This is a way of ensuring that OXP authors don’t inadvertently change users’ settings for core game log messages.
Additionally, log settings now affect the printing of
log()
messages in the debug console, if they use an explicit log message class. If they don’t, the message is still logged with the class
script.debug.message
, which is off by default, but shown in the console anyway.
The suggested way of using this is to use log message classes beginning with
<yourName>.<oxpName>
, put a logcontrol.plist in the OXP turning this message class
off, and put another one in your AddOns folder turning it
on. This way, you will see your log messages and users, by default, will not, without having to delete them from your scripts.
For example, I might call
log("ahruman.shadyBillboard.didSomething", "Something happened to " + this.ship);
in a script, and put
{ ahruman.shadyBillboard = off; }
in the OXP’s logcontrol.plist. The message could then be enabled on my computers with a loose file, or with the console command
:logOn ahruman.shadyBillboard
.
Log settings are loaded from the following locations, from lowest to highest priority:
- logcontrol.plist inside OXPs, but only in hierarchies not defined by the built-in plist.
- Built-in logcontrol.plist.
- Loose logcontrol.plist files in AddOns folders.
- Preferences (settable through the debug console).
Because the settings are loaded very early, before the state of strict mode has been set, OXP settings are always loaded. Since they shouldn't have any effect in strict mode, that's fine.