pi_portal.modules.mixins.read_log_file.LogFileReader
- class pi_portal.modules.mixins.read_log_file.LogFileReader[source]
Bases:
objectAdds logging features to an existing class.
- tail(requested_lines: int) List[Dict[Any, Any]][source]
Read the specified number of lines from the end of a log file.
Lines that are not JSON formatted are dropped silently.
- Parameters:
requested_lines (int) – The number of lines to read.
- Returns:
An array containing the lines read from the log file.
- Return type:
List[Dict[Any, Any]]