mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-22 01:51:47 +00:00
Add dependency on sl4j-handroid
This redirects log messages from libraries that use SL4J (like mina-ssh) to the Android logger so they show up in logcat.
This commit is contained in:
parent
d963faf675
commit
2e247f8e2b
@ -174,6 +174,7 @@ dependencies {
|
||||
implementation(libs.androidx.gridlayout)
|
||||
implementation(libs.material)
|
||||
implementation(libs.disklrucache) //For caching album art bitmaps
|
||||
implementation(libs.slf4j.handroid)
|
||||
|
||||
implementation(libs.apache.sshd.core)
|
||||
implementation(libs.apache.mina.core) //For some reason, makes sshd-core:0.14.0 work without NIO, which isn't available until Android 8 (api 26)
|
||||
|
@ -38,6 +38,7 @@ sshdCore = "0.14.0"
|
||||
swiperefreshlayout = "1.1.0"
|
||||
uiToolingPreview = "1.5.1"
|
||||
univocityParsers = "2.9.1"
|
||||
sl4j = "2.0.4"
|
||||
|
||||
[libraries]
|
||||
accompanist-themeadapter-material3 = { module = "com.google.accompanist:accompanist-themeadapter-material3", version.ref = "accompanistThemeadapterMaterial3" }
|
||||
@ -84,6 +85,7 @@ powermock-module-junit4 = { module = "org.powermock:powermock-module-junit4", ve
|
||||
reactive-streams = { module = "org.reactivestreams:reactive-streams", version.ref = "reactiveStreams" }
|
||||
rxjava = { module = "io.reactivex.rxjava2:rxjava", version.ref = "rxjava" }
|
||||
univocity-parsers = { module = "com.univocity:univocity-parsers", version.ref = "univocityParsers" }
|
||||
slf4j-handroid = { group = "com.gitlab.mvysny.slf4j", name = "slf4j-handroid", version.ref = "sl4j" }
|
||||
|
||||
[plugins]
|
||||
android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" }
|
||||
|
@ -9,6 +9,7 @@ package org.kde.kdeconnect;
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@ -23,6 +24,8 @@ import org.kde.kdeconnect.Helpers.SecurityHelpers.SslHelper;
|
||||
import org.kde.kdeconnect.Plugins.Plugin;
|
||||
import org.kde.kdeconnect.Plugins.PluginFactory;
|
||||
import org.kde.kdeconnect.UserInterface.ThemeUtil;
|
||||
import org.kde.kdeconnect_tp.BuildConfig;
|
||||
import org.slf4j.impl.HandroidLoggerAdapter;
|
||||
|
||||
import java.security.cert.CertificateException;
|
||||
import java.util.Set;
|
||||
@ -49,6 +52,7 @@ public class KdeConnect extends Application {
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
instance = this;
|
||||
setupSL4JLogging();
|
||||
Log.d("KdeConnect/Application", "onCreate");
|
||||
ThemeUtil.setUserPreferredTheme(this);
|
||||
DeviceHelper.initializeDeviceId(this);
|
||||
@ -60,6 +64,12 @@ public class KdeConnect extends Application {
|
||||
loadRememberedDevicesFromSettings();
|
||||
}
|
||||
|
||||
private void setupSL4JLogging() {
|
||||
HandroidLoggerAdapter.DEBUG = BuildConfig.DEBUG;
|
||||
HandroidLoggerAdapter.ANDROID_API_LEVEL = Build.VERSION.SDK_INT;
|
||||
HandroidLoggerAdapter.APP_NAME = "KDEConnect";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTerminate() {
|
||||
Log.d("KdeConnect/Application", "onTerminate");
|
||||
|
Loading…
x
Reference in New Issue
Block a user