mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Garmin: Replace SLF4J 2.0 fluent API call with 1.x-compatible logging
LOG.atLevel(logLevel).log(...) in NativeFITMessage.getFieldDefinition uses the SLF4J 2.0 fluent API, which logback-android 3.0.0 does not implement. This throws AbstractMethodError at runtime, crashing the FitAsyncProcessor thread and aborting the entire Garmin device sync when a .FIT file triggers the type/size mismatch path. Replace with a switch dispatching to LOG.debug/info/warn.
This commit is contained in:
+7
-11
@@ -2700,17 +2700,13 @@ public class NativeFITMessage {
|
||||
}
|
||||
|
||||
if (logLevel != null) {
|
||||
LOG.atLevel(logLevel).log(
|
||||
"Native for {}[{}] is of type {} with size {} (base: {}), but message declares {} with size {} (base: {})",
|
||||
name(),
|
||||
fieldDefinitionPrimitive.name,
|
||||
stdBaseType,
|
||||
fieldDefinitionPrimitive.size,
|
||||
stdBaseType.getSize(),
|
||||
baseType,
|
||||
size,
|
||||
baseType.getSize()
|
||||
);
|
||||
final String msg = "Native for {}[{}] is of type {} with size {} (base: {}), but message declares {} with size {} (base: {})";
|
||||
final Object[] args = new Object[]{name(), fieldDefinitionPrimitive.name, stdBaseType, fieldDefinitionPrimitive.size, stdBaseType.getSize(), baseType, size, baseType.getSize()};
|
||||
switch (logLevel) {
|
||||
case DEBUG: LOG.debug(msg, args); break;
|
||||
case INFO: LOG.info(msg, args); break;
|
||||
default: LOG.warn(msg, args); break;
|
||||
}
|
||||
|
||||
if (size == 1 && (baseType == BaseType.UINT16 || baseType == BaseType.UINT32 || baseType == BaseType.UINT64)) {
|
||||
// very common issue for COROS:
|
||||
|
||||
Reference in New Issue
Block a user