logcontrol.plist in OXP Config folder not read by game

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

logcontrol.plist in OXP Config folder not read by game

Post by Capt. Murphy »

Hi,

I want to include a modified logcontrol.plist with a little test OXP I'm planning on asking a few members to test for me. If the logcontrol.plist is sat loose in the AddOns folder it is picked up by the game and the additional logging that is enabled is produced. If it is in the OXP's Config folder it is not picked up by the game.... :?

I've double checked for any other logcontrol.plists in other OXPs and there aren't any.

Is this a bug or by design?
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: logcontrol.plist in OXP Config folder not read by game

Post by JensAyton »

Capt. Murphy wrote:
Is this a bug or by design?
It’s by design, but the situation has changed since the decision was made. At the time, OXPs couldn’t use custom log message classes, so an OXP logcontrol.plist could only modify default behaviour – most likely by enabling script debug logging, which would affect all OXPs.

I still don’t like the idea of an OXP changing built-in log message classes – distributing a loose file for testers would seem to cover the legitimate uses. However, with the current JS logging, an OXP could turn its own log messages off by default. Possibly we should allow OXP logcontrol.plists but ignore settings that override built-in keys (and their descendants).
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: logcontrol.plist in OXP Config folder not read by game

Post by JensAyton »

Ahruman wrote:
Possibly we should allow OXP logcontrol.plists but ignore settings that override built-in keys (and their descendants).
I’ve been playing around with this, but there’s a problem of sorts: if an OXP disables its own log messages, they don’t show up in the log, but they do show up in the debug console. As I see it, this isn’t the Right Thing.

Proposed fix:
  • If an OXP explicitly specifies a message class in a log() call, and that message class is disabled, the message doesn’t appear anywhere.
  • If no message class is specified, the behaviour is unchanged – it’s logged if [script.debug.message] is enabled, and printed in the debug console regardless.
Since existing OXPs which specify message classes should be using ones that aren’t in the built-in logcontrol.plist, and hence will be enabled by default, this shouldn’t cause any surprises. Any objections?
Post Reply