Ble Log
object BleLog
Global logging configuration for BLE-X library.
This object provides centralized logging functionality for the entire BLE-X library. It allows configuration of the logging implementation, minimum log level, and provides convenient shorthand methods for logging at different levels.
Configuration
Setting a Custom Logger
// Use a custom logger implementation
BleLog.logger = MyCustomLogger()Content copied to clipboard
Setting the Minimum Log Level
// Only show warnings and errors
BleLog.setLevel(LogLevel.WARN)
// Show all logs
BleLog.setLevel(LogLevel.VERBOSE)Content copied to clipboard
Disabling Logging
// Completely disable all logging
BleLog.disable()Content copied to clipboard
Thread Safety
The logger and minLevel properties are marked as @Volatile to ensure visibility across threads. However, if you need to atomically check and set these properties, external synchronization is required.
Logging Methods
Shorthand logging methods are provided for convenience: