From 174f67229129e913fa5d10fc3c81988a35c20290 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sun, 10 Sep 2023 14:22:30 +0530 Subject: [PATCH] chore(README): document `loggerFunction` parameter --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 36745db..e3f8741 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,18 @@ traceLog { } ``` +The `loggerFunction` parameter must be a fully qualified to a static method with a single parameter of the type `Any?`. + +```kotlin +fun recordMessage() {} // Bad, no parameter +fun recordMessage(p0: String, p1: Int) {} // Bad, multiple parameters and incorrect types +fun recordMessage(p0: Any?) {} // Good, single parameter with correct type +``` + +> [!NOTE] +> Due to a limitation in how TraceLog resolves the logger function, you might need to add `@JvmStatic` on the method +> for TraceLog to be able to find it. This will be fixed in a future release. + ## Usage Currently, this prints out a basic textual representation of the method's inputs and execution time. That is,