12 Jul 2021 00:48:15 UTC
- Distribution: Vote-Count
- Module version: 2.01
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (3)
- Testers (7 / 0 / 0)
- KwaliteeBus factor: 1
- 95.97% Coverage
- License: gpl_3
- Perl: v5.24.0
- Activity24 month
- Download (289.88KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- Reverse dependencies
- CPAN Testers List
- Dependency graph
- VERSION 2.01
- Vote::Count Logging Methods
- Logging Events
- Debug Flag
Sets a path and Naming pattern for writing logs with the WriteLogs method.
'LogTo' => '/logging_path/election_name'
LogTo will not create a new directory if the directory does not exist.
The default log location is '/tmp/votecount'.
Specifies a Path to the Log Files, unlike LogTo, LogPath will create the Path if it does not exist.
Sets the Base portion of the logfile names, but only if LogPath is specified. The default value is votecount.
Write the logs appending '.brief', '.full', and '.debug' for the three logs where brief is a summary written with the logt (log terse) method, the full transcript log written with logv, and finally the debug log written with logd. Each higher log level captures all events of the lower log levels.
Logged events are not written until WriteLog is called. A fatal runtime error, would prevent execution of a writelog at the end of the script. If you need to see the logs when your program is crashing, set the Debug Flag to write the events as warnings to STDERR while the script is running.
When logging from your methods, use logt for events that produce a summary, use logv for events that should be in the full transcript such as round counts, and finally debug is for events that may be helpful in debugging but which should not be in the transcript. Events written to logt will be included in the verbose log and all events in the verbose log will be in the debug log.
The logx methods will return the current log if called without any message to log.
Record message to the terse (.brief) log.
Record message to the more verbose (.full) log.
Record message to the debug (.debug) log.
When the debug flag is logx methods will also emit the event as a warning (STDERR). The Debug Flag defaults to off (0), but can be explicitly set via the new method of a Vote::Count object, or toggled by passing 0 or 1 via the Debug Method.
$Election->Debug(1); # turn debug on is( $Election->Action(), $expected, 'Thing Im debugging'); $Election->Debug(0); # turn debug off
John Karr (BRAINBUZ) firstname.lastname@example.org
Copyright 2019-2021 by John Karr (BRAINBUZ) email@example.com.
This module is released under the GNU Public License Version 3. See license file for details. For more information on this license visit http://fsf.org.
This software is provided as is, per the terms of the GNU Public License. Professional support and customisation services are available from the author.