Advanced-Config
view release on metacpan or search on metacpan
# -----------------------------------------------------------------------------
# What if a test case fails?
# -----------------------------------------------------------------------------
In this case there should already be logs to send out. Each and every test
program that comes with this module generates very verbose logging of what's
happening. So just open a CPAN ticket and attach the log to the ticket. Do
not cut and paste the logs contents into the ticket! It just makes the ticket
unreadable.
These logs can be found under t/log_details/*.txt
# -----------------------------------------------------------------------------
# What if it's your program that's failing?
# Then you need to turn on Fred::Fish::DBUG tracing used by Advanced::Config.
# This will generate the log file to attach to the CPAN ticket.
# -----------------------------------------------------------------------------
This module uses Fred::Fish::DBUG for logging the activity of this module.
But this logging is disabled by default, even if you are using Fred::Fish::DBUG
to trace your own code!
So here's a list of steps needed to turn this tracing on.
1) Set this special environment variable to 1. (tells my module to enable fish.)
a) Unix: export ADVANCED_CONFIG_FISH=1
b) Windows: set ADVANCED_CONFIG_FISH=1
c) You can also set this variable in your test program's BEGIN block:
$ENV{ADVANCED_CONFIG_FISH} = 1;
Just make sure your BEGIN block appears before you source in
Advanced::Config via: eval "use Advanced::Config";
2) In your code source in the Fred::Fish::DBUG module.
use Fred::Fish::DBUG;
3) Turn on fish logging at the start of your test program:
DBUG_PUSH ("my_fish_log.txt"); # Turns fish on ...
4) Feel free to use the Fred::Fish::DBUG module in your test program as well
to help document the flow of your test code.
Just be aware that turning on this logging can significantly slow down your
program because of all the details being written to the logs by Advanced::Config.
So only set the 'ADVANCED_CONFIG_FISH' environment variable when you really need
to see detailed logging.
# -----------------------------------------------------------------------------
# Major features of this module:
# -----------------------------------------------------------------------------
1) Supports simple config files. (Tag/Value pairs with comments.)
2) Supports sourcing in other config files to dynamically create one big
config file to reference as a single object.
3) Supports the use of variables in the config file.
4) Supports the use of sections to better organize your config file's data.
5) Supports inheritance between sections.
6) Supports encrypting/decrypting values in your config files to keep
the contents of your config files safe from prying eyes but usable in
your code.
7) Supports the overriding of the default operators used. Such as using
different comment indicators or other special symbols interpreted when
loading the config file into memory.
8) Detecting if a config file has been updated since your program first
loaded it for dynamic refreshes for long running processes.
9) Custom accessor functions (get_*), allowing you to do basic validation
that each tag contains the expected data type.
10) And many, many more features.
( run in 1.551 second using v1.01-cache-2.11-cpan-39bf76dae61 )