Repository navigation
Writer
com.jordansamhi.androspecter.printers.Writer is a compatibility facade over SLF4J. In the 2.0.0 API, it no longer prints directly to the console or adds symbol prefixes. The calling application supplies a logging provider and configures levels and destinations.
| Method | SLF4J level |
|---|---|
perror(message) |
ERROR |
pwarning(message) |
WARN |
pinfo(message) |
INFO |
psuccess(message) |
INFO |
Messages are passed unchanged. perror does not throw or exit the JVM; it only emits a log event subject to the provider's configuration.
Writer.v() returns the shared facade using the logger named after Writer. new Writer() uses that same logger name. new Writer(logger) accepts an application-selected SLF4J logger and rejects null.
This complete utility class lets the calling application decide when an operation is complete:
import com.jordansamhi.androspecter.printers.Writer;
import org.slf4j.LoggerFactory;
public final class LoggingExample {
private static final Writer LOG =
new Writer(LoggerFactory.getLogger(LoggingExample.class));
/**
* Reports a caller-provided count through the configured SLF4J provider.
* @param findings number of findings returned by the caller's analysis
*/
public static void report(int findings) {
LOG.pinfo("Analysis returned " + findings + " findings");
}
}For new application code, using org.slf4j.Logger directly also supports parameterized messages and exception arguments. Writer provides only the four single-string methods above.
AndroSpecter supplies slf4j-api 2.0.17, not a runtime provider. Add one provider such as org.slf4j:slf4j-simple:2.0.17 with runtime scope in the calling application. See Cancellation and logging for the dependency declaration and the distinction between analysis logs and injected Android logging probes.
- Analysis sessions
- APK metadata
- Call graphs and inspection
- Graph export and comparison
- Taint analysis
- Instrumentation
- Cancellation and logging
- Migration and troubleshooting
- Publishing releases