Advertisement
Guest User

Untitled

a guest
Nov 13th, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.12 KB | None | 0 0
  1. ---+!! %TOPIC%
  2.  
  3. %TOC%
  4.  
  5. ---++ Create a new configure section called "Developer Settings"
  6.  
  7.  
  8.  
  9.  
  10.  
  11. ---+++ Background
  12.  
  13. In the 1.1 branch, there was a setting called "WarningsAreErrors" which was useful in
  14. development Foswikis. This setting has been eliminated in trunk - replaced with settings
  15. at the top of ==LocalLib.cfg==
  16. <verbatim>
  17. #development and debugging settings
  18. #$ENV{FOSWIKI_ASSERTS} = 1;
  19. #$ENV{FOSWIKI_MONITOR} = 1;
  20. </verbatim>
  21.  
  22. These settings must be set in LocalLib.cfg outside of configure, because they need to be
  23. set before the configuration is loaded.
  24.  
  25. ---+++ Proposal - Bare Minimum
  26.  
  27. We should create a new top-level configure section called "Developer Settings". Even though these
  28. settings can't be controlled via configure, the current values can be displayed and also
  29. the legal values can be enumerated right on the web page.
  30.  
  31. ---+++ Proposal - spec file enhancement
  32.  
  33. In many places in the core code & in modules, there are hard-coded values that could be useful
  34. to investigate problems:
  35.  
  36. <verbatim>
  37. $ perl -e 'use Foswiki::PageCache; print Foswiki::PageCache::TRACE'
  38. $ perl -e 'use Foswiki::Sandbox; print Foswiki::Sandbox::TRACE'
  39. </verbatim>
  40.  
  41. <strike>
  42. We could change the syntax of 'config.spec' files to allow for a new entry type.
  43.  
  44. <verbatim>
  45. #---+ Developer Settings
  46.  
  47. # **DEVELOPER**
  48. # Set this to 1 to enable detailed diagnostics of the page cache, 0 to disable.
  49. $Foswiki::cfgIgnored{PageCacheTRACE} = 'use Foswiki::PageCache; print Foswiki::PageCache::TRACE';
  50.  
  51. # **DEVELOPER**
  52. # Set to 1 to trace commands to STDERR, and redirect STDERR from
  53. # the command subprocesses to /tmp/foswiki_sandbox.log
  54. $Foswiki::cfgIgnored{SandboxTRACE} = 'use Foswiki::Sandbox; print Foswiki::Sandbox::TRACE';
  55. </verbatim>
  56.  
  57. These settings should not be automatically loaded on startup, they should be loaded on demand
  58. using the new validation framework (similarly to Web server environment >> Analyze Environment Now).
  59. </strike>
  60.  
  61. ---+++ Proposal - scan entire lib directory, following System.PerlDoc approach
  62. Instead of the above approach, it might be better to avoid the 'specfile' approach altogether and
  63. follow something more simpatico with System.PerlDoc :
  64.  
  65. <verbatim>
  66. in Foswiki/Sandbox.pm
  67.  
  68. =begin TML
  69. ---+ DeveloperSetting TRACE
  70. Set to 1 to trace commands to STDERR, and redirect STDERR from
  71. the command subprocesses to /tmp/foswiki_sandbox.log
  72. =cut
  73. use constant TRACE => 0;
  74. </verbatim>
  75.  
  76. System.PerlDoc already has the ability to let the user decide if he wants to see 'public' methods or not
  77. (currently not visible in the UI). This could be re-enabled, clearly Developer Settings should not be public.
  78.  
  79. When the DeveloperSettings button is clicked in configure, it will:
  80. * scan every file in lib, looking for DeveloperSetting inside pod docs
  81. * scan the text after =cut looking for the next semi-colon
  82. This could be rendered like this:
  83.  
  84. <verbatim>
  85. ---+ Foswiki::Sandbox::TRACE
  86. Set to 1 to trace commands to STDERR, and redirect STDERR from
  87. the command subprocesses to /tmp/foswiki_sandbox.log
  88. <div class="something nice">
  89. Foswiki/Sandbox.pm:43
  90. use constant TRACE => 0;
  91. </div>
  92. </verbatim>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement