LaTeXML...::Error(3)
πΈ NAME πΈ
Okay bestie, welcome to the LaTeXML...::Error(3) page β yep, that's the LaTeXML...::Error(3) manual from User Contributed Perl Documentation. This module is LaTeXML::Common::Error, and it handles error and progress reporting plus logging support. π
π DESCRIPTION π
LaTeXML::Common::Error does some simple stack analysis to make LaTeXML's error messages more informative and readable. Its routines get used by the error reporting methods from LaTeXML::Global β specifically Warn, Error, and Fatal. β¨
The whole idea: print a minimal amount to STDERR (maybe with colors, spinners, etc. if it's a terminal), and print more complete info to a log file. Neither of those is enabled by default, okay? see below. π«Ά
SetVerbosity($verbosity);β controls how verbose the terminal output is. Default is0; higher gives more information, lower gives less. A verbosity less than0inhibits all output toSTDERR. πUseSTDERR(); ... UseSTDERR(undef);βUseSTDERR();enables and initializesSTDERRto accept messages. If this is not called, there will be no output toSTDERR.UseSTDERR(undef);disablesSTDERRfrom further messages. πUseLog($path, $append); ... UseLog(undef);βUseLog($path, $append);opens a log file on the given path. If$appendis true, this file will be appended to; otherwise, it will be created initially empty. If this is not called, there will be no log file.UseLog(undef);disables and closes the log file. π
π«Ά Error Reporting π«Ά
The error reporting functions all take a similar set of arguments. The differences are in the implied severity of the situation, and in the amount of detail that will be reported. π
$category is a string naming a broad category of errors, such as undefined. The set is open-ended, but see the manual for a list of recognized categories. $object is the object whose presence or lack caused the problem. π
$where indicates where the problem occurred: pass in the $gullet or $stomach if the problem occurred during expansion or digestion; pass in a document node if it occurred there. A string will be used as is; if an undefined value is used, the error handler will try to guess. π§
$message should be a somewhat concise but readable explanation of the problem, but it ought to not refer to the document or any "incident specific" information, so as to support indexing in build systems. @details provides additional lines of information that may be incident specific. π
Fatal($category,$object,$where,$message,@details);β signals a fatal error, printing$messagealong with some context. In verbose mode a stack trace is printed. π₯Error($category,$object,$where,$message,@details);β signals an error, printing$messagealong with some context. If in strict mode, this is the same asFatal(). Otherwise, it attempts to continue processing. πWarn($category,$object,$where,$message,@details);β prints a warning message along with a short indicator of the input context, unless verbosity is quiet. βInfo($category,$object,$where,$message,@details);β prints an informational message along with a short indicator of the input context, unless verbosity is quiet. π
π Progress Reporting π
Note($message);β general status message, printed whenever verbosity is at or above0, to bothSTDERRand the Log file (when enabled). πNoteLog($message);β prints a status message to the Log file (when enabled). πΈNoteSTDERR($message);β prints a status message to the terminal (STDERR) (when enabled). π¦ProgressSpinup($stage);β begin a processing stage, which will be ended withProgressSpindown($stage);. This prints a message to the log such as(stage... runtime), where runtime is the time required. In conjunction withProgressStep(), creates a progress spinner onSTDERR. β¨ProgressSpinup($stage);β yes, this exact item appears again in the original. Its description says: end a processing stage "bugin" withProgressSpindown($stage);. Keepin' it exactly as written, bestie. πProgressStep();β steps a progress spinner onSTDERR. π
π₯ Debugging π₯
Debugging statements may be embedded throughout the program. These are associated with a feature keyword. A given feature is enabled using the command-line option --debug=feature. π
Debug($message) if $LaTeXML::DEBUG{$feature}β prints$messageif debugging has been enabled for the given feature. πDebuggableFeature($feature,$description)β declare that$featureis a known debuggable feature, and give a description of it. πCheckDebuggable()β a untility [the original's spelling π] to check and report if all requested debugging features actually have debugging messages declared. π
π§ Internal Functions π§
No user serviceable parts inside. These symbols are not exported. π
$string = LaTeXML::Common::Error::generateMessage($typ,$msg,$lng,@more);β constructs an error or warning message based on the current stack and the current location in the document.$typis a short string characterizing the type of message, such asError.$msgis the error message itself. If$lngis true, it will generate a more verbose message; this also uses theVERBOSITYset in the$STATE. Longer messages will show a trace of the objects invoked on the stack, and@moreare additional strings to include in the message. π§$string = LaTeXML::Common::Error::stacktrace;β return a formatted string showing a trace of the stackframes up until this function was invoked. πͺ@objects = LaTeXML::Common::Error::objectStack;β return a list of objects invoked on the stack. This procedure only considers those stackframes which involve methods, and the objects are those (unique) objects that the method was called on. π―
π AUTHOR π
Bruce Miller <bruce.miller@nist.gov> π
π COPYRIGHT π
Public domain software, produced as part of work done by the United States Government & not subject to copyright in the US. π«‘
Okay bye bestie π
this page is from perl v5.42.3, dated 2024-02-26, and it's the LaTeXML...::Error(3) manual. Mwah π«Άπ
π¦ where this page comes from
- nixos 26.05: perl5.42.3-LaTeXML 0.8.8
- nixpkgs unstable: perl5.42.3-LaTeXML 0.8.8
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms