Function parseSystemLogContent

  • Parses a system log string into an array of structured SystemLogLine objects.

    Each log entry is expected to start with a timestamp in the format YYYY-MM-DD HH:MM:SS.sss. The function uses a regular expression to split the content into individual log entries, then parses each entry into a SystemLogLine using parseSystemLogLine.

    Returns

    An array of SystemLogLine objects representing each parsed log entry.

    Example

    const logContent = '2025-12-05 10:01:23.123 Info: started\n2025-12-05 10:01:24.456 Error: failed';
    const lines = parseSystemLogContent(logContent);
    console.log(lines[0].timestamp); // → Date object for '2025-12-05 10:01:23.123'

    Remarks

    • Entries that cannot be parsed by parseSystemLogLine are ignored.
    • The regular expression uses the s (dotAll) flag, which may not be supported in all browsers; a @ts-ignore is used to suppress TypeScript warnings.

    Parameters

    • content: string

      The full system log content as a string.

    Returns SystemLogLine[]

Generated using TypeDoc