Beispiel #1
0
def get_last_record(logtype):
    try:
        with eventlog(logtype) as log_handle:
            oldest = win32evtlog.GetOldestEventLogRecord(log_handle)
            total = win32evtlog.GetNumberOfEventLogRecords(log_handle)
            result = oldest + total - 1
            return result if result >= 0 else 0
    except Exception:
        return 0
def get_last_record(logtype):
    try:
        with eventlog(logtype) as log_handle:
            oldest = win32evtlog.GetOldestEventLogRecord(log_handle)  # pylint: disable=c-extension-no-member
            total = win32evtlog.GetNumberOfEventLogRecords(log_handle)  # pylint: disable=c-extension-no-member
            result = oldest + total - 1
            return result if result >= 0 else 0
    except Exception:
        return 0