Represents a log file manager that appends log entries to a file. It does not ensure extremely precise ordering of log entries' timestamps if used asynchronously. It logs them as they are received.
Creates a new instance of the LogFile class.
The path to the log file.
Appends a log entry to the log file.
The data to be logged.
The timestamp of the log entry. Defaults to the current time.
A promise that resolves when the log entry is appended.
Ensures that the directory containing the log file exists.
Returns an async generator that yields the entries (timestamp and value) of log entries in the log file.
The entries (timestamp and value) of log entries.
Returns an async generator that yields the timestamps of log entries in the log file.
The timestamps of log entries.
Reads the log entire file and returns an array of log entries, sorted by timestamp in descending order.
An array of log entries, sorted by timestamp in descending order.
Resets the log file by removing it.
Returns an async generator that yields the values of log entries in the log file.
The values of log entries.
Generated using TypeDoc
Represents a log file manager that appends log entries to a file. It does not ensure extremely precise ordering of log entries' timestamps if used asynchronously. It logs them as they are received.