-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JVM: Logging cannot be configured (PagingLogger
spams output)
#269
Comments
PagingLogger
spams output)PagingLogger
spams output)
Should be easy to switch to Logger. Want to send a PR? No one is currently working on this repo, but I'd merge a fix if someone else wanted to contribute it. |
@JakeWharton Hello I ran into the same issue. can you please tell me how I can change the logger? |
Until you or somebody sends a PR to switch to |
<dependency>
<groupId>androidx.paging</groupId>
<artifactId>paging-common-jvm</artifactId>
<version>1.14</version>
<scope>3.3.0-alpha02</scope>
<systemPath>your local path paging-common-jvm-3.3.0-alpha02.jar</systemPath>
</dependency>
import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtMethod;
import org.apache.commons.io.IOUtils;
import org.junit.Test;
import java.nio.file.Files;
import java.nio.file.Paths;
public class FixPagingLogger {
@Test
public void test() throws Exception {
final ClassPool pool = ClassPool.getDefault();
final CtClass clazz = pool.get("androidx.paging.PagingLogger");
final CtMethod method = clazz.getDeclaredMethod("isLoggable");
method.setBody("return false;");
IOUtils.write(clazz.toBytecode(), Files.newOutputStream(Paths.get("PagingLogger.class")));
clazz.detach();
}
}
build.gradle.kts(IMPORTANT!!!) implementation("app.cash.paging:paging-compose-common:3.3.0-alpha02-0.5.1") {
exclude(group = "androidx.paging", module = "paging-common-jvm")
}
// Here we introduce the modified paging-common-jvm-3.3.0-alpha02.jar file
implementation(fileTree("${projectDir}/libs")) THIS IS MY MODIFIED JAR FILE (I SUGGEST YOU DON'T TRUST ANY UNOFFICIAL JAR FILE, YOU NEED TO GO THROUGH IT MANUALLY YOURSELF) |
I had reported to Google this issue and still nothing's been done. I'll make a PR, that should be okay until Google hopefully does something? |
Great work guys with the library, but currently there is a small problem:
Paging version:
3.3.0-alpha02-0.5.1
Platform:
JVM
The built-in logging cannot be configured.
This leads to thousands of lines of VERBOSE and DEBUG output.
Currently the JVM
PagingLogger
is hardwired for some reason:isLoggable()
always returnstrue
.PagingLogger.jvm.kt
:example log spam when scrolling a paginated list:
The text was updated successfully, but these errors were encountered: