Logging

Out of the box Bugsee automatically captures all standard applications console logs (print, NSLog) both from Swift and Objective-C, both on iOS 10 and prior. If that behavior is not desired, it can be disabled through Bugsee launch options, see BugseeCaptureLogsKey option in configuration.

OSLog

Experimental feature.

Starting iOS 15 Bugsee can capture OSLog and Logger print statements. Bugsee uses OSLogStore to achieve this. To capture these logs you need to enable a separate BugseeCaptureOSLogsKey (turned off, by default). See BugseeCaptureOSLogsKey option in configuration.

Note. This feature requires OSLog.framework to be linked.

Loggers

Alternatively, we provide other methods to log messages directly into Bugsee reports. These methods maintain log levels for each message and later allow filtering in Bugsee report viewer.

CocoaLumberjack logger

If you are using CocoaLumberjack, Bugsee includes a logger that can be hooked to Lumberjack.

!Objective-C

[BugseeLogger install];

!Swift

BugseeLogger.install() 

Logging API

You can use Bugsee logging interface directly, we provide two API functions for send a message to a log:

!Objective-C

// With default log level (normal)
[Bugsee log:@"Some log message"];

// Set the log level explicitly
// Levels are BugseeLogLevelLow, BugseeLogLevelError, BugseeLogLevelWarning,
// BugseeLogLevelInfo, BugseeLogLevelDebug and BugseeLogLevelVerbose
[Bugsee log:@"Some log message" level:BugseeLogLevelInfo];

!Swift

// With default log level (normal)
Bugsee.log("Some log message")

// Set the log level explicitly
// Levels are BugseeLogLevelLow, BugseeLogLevelError, BugseeLogLevelWarning,
// BugseeLogLevelInfo, BugseeLogLevelDebug and BugseeLogLevelVerbose
Bugsee.log("Some log message", level:BugseeLogLevelInfo)