Questions tagged [oslog]
41 questions
1
vote
1 answer
Swift Unified Logging
I was searching for some information on how to do proper logging in swift. I found Unified Logging: https://developer.apple.com/documentation/os/logging.
When trying it, I couldn't figure out how I can see the logs for only my defined Subsystem and…

manban
- 133
- 1
- 19
1
vote
2 answers
How can I open/view iOS OSLogs stored on device?
I'm creating logs using Apple's os.log framework. I'm just making logs like:
os_log("Update: Lat: %{public}f | Long: %{private}f | RemainingTime: %{public}f ", log: log, type: .default, location.coordinate.latitude, location.coordinate.longitude,…

mfaani
- 33,269
- 19
- 164
- 293
0
votes
1 answer
How to hide OSLogs from Xcode's console
Is there a way to filter out or simply disable OSLogs within Xcode (or more broadly)?
I can see that Xcode is going out of its way to integrate the OSLogs into its console, as opposed to them being just part of stdout/stderr from my process, because…

Wade Tregaskis
- 1,996
- 11
- 15
0
votes
1 answer
MacOS unified log with oslog crate
I'd like to write to Apple's unified log on macOS from Rust.
I found the oslog crate which seems promising and I have the following code so far:
#[macro_use]
extern crate log;
use oslog::OsLogger;
fn main() {
//env_logger::init();
…

Marin Todorov
- 6,377
- 9
- 45
- 73
0
votes
0 answers
Arranging signpost intervals hierarchically or chronologically in Xcode Instruments
I'm trying to use signposts to profile the performance of a fairly complex piece of (synchronization) logic. The signposts I create have names like: "Syncing A", "Downloading A", "Uploading A", "Syncing B", "Downloading B", "Uploading B". The app…

Andrii Chernenko
- 9,873
- 7
- 71
- 89
0
votes
1 answer
Instruments OSSignpost intervals not recording or displaying
I'm trying to use OSSignposter to capture intervals in our app for use in Instruments. The sample code here works in a new project. I see the intervals, signpost icons, etc. However, this same code (integrated into a much bigger app does not record…

Byron
- 1,091
- 11
- 27
0
votes
1 answer
OSLogStore on watchOS doesn't return entries
Hello.
I'm developing a tightly coupled watchOS/iOS app. The customer needs to be able to write logs to text files, from both apps, in a hassle-free way.
So I want to retrieve entries using OSLogStore, which works just fine on iOS:
let store = try…

szagun
- 123
- 8
0
votes
1 answer
Can't create the OSLog activity on Swift
I want to use the OSLog activities to structure my logs but I stuck with a problem of absence needed activity constants on Swift such as OS_ACTIVITY_CURRENT and OS_ACTIVITY_NONE and I have an error when I try to create an activity:
let activity =…

iUrii
- 11,742
- 1
- 33
- 48
0
votes
0 answers
os_log fault message produces "Activity for state dumps"
I'm working on a logger that is based on Unified Logging System that supports activities/scopes and I've found that a message with fault level type is not captured by any of my activities:
var os_state = os_activity_scope_state_s()
let os_activity =…

iUrii
- 11,742
- 1
- 33
- 48
0
votes
1 answer
Getting unified system logs from an iOS device
I'm trying to use unified logging to log messages and retrieve them from a device for inspection. I created a new OSLog instance with
let logDebug = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "⚠️ debug")
Then I log messages…

Tom Harrington
- 69,312
- 10
- 146
- 170
-1
votes
1 answer
How to use OSLog in Xcode 12.5.1 or Xcode 13?
I have tried using OSLog per documentation in both Xcode versions 12.5 and 13 with similar failure:
import SwiftUI
import CoreData
import OSLog
struct IdeaListView: View {
let logger = Logger()
let x = 42
logger.info("The answer is…

tgunr
- 1,540
- 17
- 31