Logging

LAST EDIT Apr 08 2021

By default logging is disabled. You can enable logs and set the log level when initializing ChatClient:

1
2
3
ChatClient client = new ChatClient.Builder("api-key", context) 
    .logLevel(ChatLogLevel.ALL) 
    .build();
1
2
3
val client = ChatClient.Builder("api-key", context) 
    .logLevel(ChatLogLevel.ALL) 
    .build()

If you need to intercept logs you can pass a logger handler:

1
2
3
4
5
6
7
8
ChatClient client = new ChatClient.Builder("api-key", context) 
    .loggerHandler(new ChatLoggerHandler() { 
        @Override 
        public void logI(@NotNull Object o, @NotNull String s) { 
 
        } 
    }) 
    .build();
1
2
3
4
5
6
7
val client = ChatClient.Builder("api-key", context) 
    .loggerHandler(object : ChatLoggerHandler { 
        override fun logI(tag: Any, message: String) { 
            TODO("Not yet implemented") 
        } 
    }) 
    .build()