arelle.logging.handlers.LogToXmlHandler¶
See COPYRIGHT.md for copyright information.
Module Contents¶
Classes¶
.. class:: LogToXmlHandler(filename) |
API¶
- class arelle.logging.handlers.LogToXmlHandler.LogToXmlHandler(cntlr: arelle.Cntlr.Cntlr | None = None, filename: str | None = None, mode: str = 'w', logXmlMaxAttributeLength: int | None = None)¶
Bases:
arelle.logging.handlers.LogHandlerWithXml.LogHandlerWithXml.. class:: LogToXmlHandler(filename)
A log handler that writes log entries to named XML file (utf-8 encoded) upon closing the application.
Initialization
- logRecordBuffer: list[logging.LogRecord]¶
None
- cntlr: arelle.Cntlr.Cntlr | None¶
None
- filename: str | None¶
None
- filemode: str¶
None
- htmlTitle: str¶
‘Arelle Message Log’
- flush() None¶
- clearLogBuffer() None¶
- getXml(clearLogBuffer: bool = True, includeDeclaration: bool = True) str¶
Returns an XML document (as a string) representing the messages in the log buffer. Optionally clears the log buffer afterwards. Optionally includes XML declaration.
- Returns:
XML string of messages in the log buffer.
- getJson(clearLogBuffer: bool = True) str¶
Returns an JSON string representing the messages in the log buffer, and clears the buffer.
- Returns:
str – json representation of messages in the log buffer
- getHtml(clearLogBuffer: bool = True) str¶
Returns an HTML string representing the messages in the log buffer, and clears the buffer.
- Returns:
str – HTML representation of messages in the log buffer
- getLines(clearLogBuffer: bool = True) list[str]¶
Returns a list of the message strings in the log buffer, and clears the buffer.
- Returns:
[str] – list of strings representing messages corresponding to log buffer entries
- getText(separator: str = '\n', clearLogBuffer: bool = True) str¶
Returns a string of the lines in the log buffer, separated by newline or provided separator.
- Parameters:
separator (str) – Line separator (default is platform os newline character)
- Returns:
str – joined lines of the log buffer.
- emit(logRecord: logging.LogRecord) None¶