Hi Eskimo! Thanks for answering.
I was able to execute that command but every step I do I get lost again.
e.g:
swift
vagrants-iMac:~ rootswift
Welcome to Apple Swift version 5.2.2 (swiftlang-1103.0.32.6 clang-1103.0.32.51).
Type :help for assistance.
1 import OSLog
2 let store = try OSLogStore.local()
store: OSLogStore = {
baseNSObject@0 = {
isa = OSLogStore
}
_source = {
NSObject = {
isa = OSLogEventSource
}
_fileRefs = 89 elements
_lcr =
_lesm =
_oldestTimeRef =
_tsdb =
}
}
3 let myDate = Date().addingTimeInterval(-3600) /* time in secs (one hour) */
myDate: Date = {}
4 let oneHourAgo = store.position(date: myDate)
oneHourAgo: OSLogPosition = uninitialized
5 let myEntries = store.getEntries(at: oneHourAgo)
myEntries: AnySequenceOSLogEntry = {
_box = extracting data from value failed
}
error: Couldn't lookup symbols:
(extension in OSLog):__C.OSLogStore.getEntries(with: __C.OSLogEnumeratorOptions, at: Swift.Optional__C.OSLogPosition, matching: Swift.Optional__C.NSPredicate) throws - Swift.AnySequence__C.OSLogEntry
(extension in OSLog):__C.OSLogStore.getEntries(with: __C.OSLogEnumeratorOptions, at: Swift.Optional__C.OSLogPosition, matching: Swift.Optional__C.NSPredicate) throws - Swift.AnySequence__C.OSLogEntry
Is there any developer guide to get log entries? I couldn't find it...
In any case, if you can provide us with a very simple code to get a log it would be a great starting point for me and the rest of the community since I couldn't find any working example, and we all will be very grateful :) thanks in advance for any guidance you can provide me ^^
Topic:
App & System Services
SubTopic:
Core OS
Tags: