File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -223,6 +223,23 @@ try (LlamaModel model = new LlamaModel(modelParams)) {
223
223
}
224
224
```
225
225
226
+ ### Logging
227
+
228
+ Per default, logs are written to stdout.
229
+ This can be intercepted via the static method ` LlamaModel.setLogger(LogFormat, BiConsumer<LogLevel, String>) ` .
230
+ There is text- and JSON-based logging. The default is JSON.
231
+ To only change the log format while still writing to stdout, ` null ` can be passed for the callback.
232
+ Logging can be disabled by passing an empty callback.
233
+
234
+ ``` java
235
+ // Re-direct log messages however you like (e.g. to a logging library)
236
+ LlamaModel . setLogger(LogFormat . TEXT , (level, message) - > System . out. println(level. name() + " : " + message));
237
+ // Log to stdout, but change the format
238
+ LlamaModel . setLogger(LogFormat . TEXT , null );
239
+ // Disable logging by passing a no-op
240
+ LlamaModel . setLogger(null , (level, message) - > {});
241
+ ```
242
+
226
243
## Importing in Android
227
244
228
245
You can use this library in Android project.
You can’t perform that action at this time.
0 commit comments