Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---+!! %TOPIC%
- %TOC%
- ---++ 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==
- <verbatim>
- #development and debugging settings
- #$ENV{FOSWIKI_ASSERTS} = 1;
- #$ENV{FOSWIKI_MONITOR} = 1;
- </verbatim>
- 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:
- <verbatim>
- $ perl -e 'use Foswiki::PageCache; print Foswiki::PageCache::TRACE'
- $ perl -e 'use Foswiki::Sandbox; print Foswiki::Sandbox::TRACE'
- </verbatim>
- <strike>
- We could change the syntax of 'config.spec' files to allow for a new entry type.
- <verbatim>
- #---+ 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';
- </verbatim>
- 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).
- </strike>
- ---+++ Proposal - scan entire lib directory, following System.PerlDoc approach
- Instead of the above approach, it might be better to avoid the 'specfile' approach altogether and
- follow something more simpatico with System.PerlDoc :
- <verbatim>
- 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;
- </verbatim>
- System.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:
- <verbatim>
- ---+ 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>
- </verbatim>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement