logHandlerFunction property

LogHandlerFunction logHandlerFunction
getter/setter pair

A function that has a parameter of type LogRecord. This is called on every new log record. By default the client will use the handler returned by _getDefaultLogHandler. Setting it you can handle the log messages directly instead of have them written to stdout, this is very convenient if you use an error tracking tool or if you want to centralize your logs into one facility.

myLogHandlerFunction = (LogRecord record) {
 // do something with the record (ie. send it to Sentry or Fabric)
}

final client = StreamChatClient("stream-chat-api-key",
logHandlerFunction: myLogHandlerFunction);

Implementation

late LogHandlerFunction logHandlerFunction;