-
Notifications
You must be signed in to change notification settings - Fork 0
Logging Output Methods
Mr.P edited this page Aug 29, 2026
·
2 revisions
Choose the minimum log level and the single destination used by the default AIBuds logger.
AIBudsLog.xcframework
/// The current log configuration.
static var logConfiguration: LogConfiguration { get }
/// Configures log storage, rotation, and output behavior.
final class LogConfiguration: NSObject {
/// The severity threshold. Defaults to `.info`.
var level: LogLevel
/// The active output destination. Defaults to `.xlfacility`.
var destination: LogDestination
/// Relative log directory under Documents. Defaults to `.aibuds/logs`.
var logsDirectory: String
/// Maximum single file size. Defaults to 10 MB.
var maxFileSize: UInt64
/// Maximum retained age in days. Defaults to 3.
var logFileMaxAge: Int
}/// The current log configuration.
@property(nonatomic, class, readonly, strong) AIBudsLogConfiguration *logConfiguration;
/// Configures log storage, rotation, and output behavior.
@interface AIBudsLogConfiguration : NSObject
/// The severity threshold. Defaults to `AIBudsLogLevelInfo`.
@property(nonatomic) AIBudsLogLevel level;
/// The active output destination. Defaults to XLFacility.
@property(nonatomic) AIBudsLogDestination destination;
/// Relative log directory under Documents. Defaults to `.aibuds/logs`.
@property(nonatomic, copy) NSString *logsDirectory;
/// Maximum single file size. Defaults to 10 MB.
@property(nonatomic) uint64_t maxFileSize;
/// Maximum retained age in days. Defaults to 3.
@property(nonatomic) NSInteger logFileMaxAge;
@endSee logConfiguration, LogLevel, and LogDestination.
level is the minimum severity recorded. Levels below it are discarded.
| Level | Use |
|---|---|
.verbose |
Fine-grained execution tracing. |
.debug |
Development diagnostics. |
.info |
Normal progress and operational information. |
.warn |
A condition that may require attention. |
.error |
A failure that may still allow the app to continue. |
.fatal |
A critical failure that may terminate the app. |
.mute |
Disable all log output. |
| Destination | Output | Export support |
|---|---|---|
.console |
Xcode debugger console | No |
.oslogger |
Apple unified logging through os_log
|
No |
.file |
Files under the configured Documents-relative directory | Yes |
.xlfacility |
AIBudsXLFacility persistence plugin |
Yes, when plugin is installed |
import AIBudsLog
import AIBudsXLFacility
let configuration = AIBudsLogSDK.logConfiguration
configuration.level = .debug
configuration.destination = .xlfacility
configuration.logFileMaxAge = 7
AIBudsLogSDK.setXLFacilityPlugin(XLFacilitySDK.shared)
AIBudsLogSDK.logService.info(
"SDK configured",
subsystem: "com.example.app",
category: "startup"
)#import <AIBudsLog/AIBudsLog-Swift.h>
#import <AIBudsXLFacility/AIBudsXLFacility-Swift.h>
AIBudsLogConfiguration *configuration = AIBudsLogSDK.logConfiguration;
configuration.level = AIBudsLogLevelDebug;
configuration.destination = AIBudsLogDestinationXlfacility;
configuration.logFileMaxAge = 7;
[AIBudsLogSDK setXLFacilityPlugin:AIBudsXLFacilitySDK.shared];
[AIBudsLogSDK.logService info:@"SDK configured" subsystem:@"com.example.app" category:@"startup"];- Destination selection is process-wide and replaces the previous destination; it is not a set of simultaneously enabled outputs.
-
logsDirectoryaccepts a Documents-relative path. A leading slash is removed by the SDK. - Values less than or equal to zero are ignored for
maxFileSizeandlogFileMaxAge. - The public SDK does not expose remote-server logging configuration or category enable/disable switches.
AIBuds SDK documentation · Full documentation · API Reference
- Introduction
- Getting Started
- Core Concepts
-
Core Features
- Basic Features
- Device Info
- Find Device
- Physical Operations
- Work Mode
- Work Status
- Wear Detection
- Volume Control
- Music Control
- TWS
- Equalizer
- ANC
- Audio
- Camera
- Remote Camera
- File Import
- Teleprompter
- Segment Navigation
- Live Streaming
- Device Applications
- OTA
- Camera OTA
- Service Auth
- AI Services
- Voice Assistant
- Logging
- Advanced Topics
- Releases
- Troubleshooting