ExposeDeveloperSettings

Create a new configure section called "Developer Settings"

Background

In the 1.1 branch, there was a setting called "WarningsAreErrors" which was useful in development Foswikis. This setting has been eliminated in trunk - replaced with settings at the top of LocalLib.cfg
#development and debugging settings
#$ENV{FOSWIKI_ASSERTS} = 1;
#$ENV{FOSWIKI_MONITOR} = 1;

These settings must be set in LocalLib.cfg outside of configure, because they need to be set before the configuration is loaded.

Proposal - Bare Minimum

We should create a new top-level configure section called "Developer Settings". Even though these settings can't be controlled via configure, the current values can be displayed and also the legal values can be enumerated right on the web page.

Proposal - spec file enhancement

In many places in the core code & in modules, there are hard-coded values that could be useful to investigate problems:

$ perl -e 'use Foswiki::PageCache; print Foswiki::PageCache::TRACE'
$ perl -e 'use Foswiki::Sandbox; print Foswiki::Sandbox::TRACE'

We could change the syntax of 'config.spec' files to allow for a new entry type.

#---+ Developer Settings

# **DEVELOPER**
# Set this to 1 to enable detailed diagnostics of the page cache, 0 to disable.
$Foswiki::cfgIgnored{PageCacheTRACE} = 'use Foswiki::PageCache; print Foswiki::PageCache::TRACE';

# **DEVELOPER**
# Set to 1 to trace commands to STDERR, and redirect STDERR from
# the command subprocesses to /tmp/foswiki_sandbox.log
$Foswiki::cfgIgnored{SandboxTRACE} = 'use Foswiki::Sandbox; print Foswiki::Sandbox::TRACE';

These settings should not be automatically loaded on startup, they should be loaded on demand using the new validation framework (similarly to Web server environment >> Analyze Environment Now).

Proposal - scan entire lib directory, following PerlDoc approach

Instead of the above approach, it might be better to avoid the 'specfile' approach altogether and follow something more simpatico with PerlDoc :

in Foswiki/Sandbox.pm

=begin TML
---+ DeveloperSetting TRACE
Set to 1 to trace commands to STDERR, and redirect STDERR from
the command subprocesses to /tmp/foswiki_sandbox.log
=cut
use constant TRACE => 0;

PerlDoc already has the ability to let the user decide if he wants to see 'public' methods or not (currently not visible in the UI). This could be re-enabled, clearly Developer Settings should not be public.

When the DeveloperSettings button is clicked in configure, it will:
  • scan every file in lib, looking for DeveloperSetting inside pod docs
  • scan the text after =cut looking for the next semi-colon
This could be rendered like this:

---+ Foswiki::Sandbox::TRACE
Set to 1 to trace commands to STDERR, and redirect STDERR from
the command subprocesses to /tmp/foswiki_sandbox.log
<div class="something nice">
Foswiki/Sandbox.pm:43
use constant TRACE => 0;
</div>
Topic revision: r2 - 14 Nov 2012, KipLubliner
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy