mattermost-api-50200.0.1: Client API for Mattermost chat system

Safe HaskellNone
LanguageHaskell2010

Network.Mattermost.Logging

Contents

Synopsis

Logging-Related Types

type Logger = LogEvent -> IO () Source #

A Logger is any function which responds to log events:

data LogEvent Source #

If there is a Logger in the ConnectionData struct, it will be sporadically called with values of type LogEvent.

Instances
Eq LogEvent Source # 
Instance details

Defined in Network.Mattermost.Types.Base

Show LogEvent Source # 
Instance details

Defined in Network.Mattermost.Types.Base

data LogEventType Source #

A LogEventType describes the particular event that happened

Constructors

HttpRequest RequestMethod String (Maybe Value) 
HttpResponse Int String (Maybe Value) 
WebSocketRequest Value 
WebSocketResponse (Either String Value)

Left means we got an exception trying to parse the response; Right means we succeeded and here it is.

WebSocketPing 
WebSocketPong 

Basic Loggers

mmLoggerInfo :: Handle -> Logger Source #

mmLoggerInfo prints which calls are happening and which endpoints are being hit, but without the payloads.

mmLoggerInfoFilter :: (LogEvent -> Bool) -> Handle -> Logger Source #

mmLoggerInfoFilter is the same as mmLoggerInfo but takes a user-defined predicate that it uses to select which events to log before writing them to the provided Handle

mmLoggerDebug :: Handle -> Logger Source #

mmLoggerDebug prints the full data of every logging event to the provided Handle.

mmLoggerDebugFilter :: (LogEvent -> Bool) -> Handle -> Logger Source #

mmLoggerDebugFilter is the same as mmLoggerDebug but takes a user-defined predicate that it uses to select which events to log before writing them to the provided Handle

stderr variants

mmLoggerInfoErr :: Logger Source #

mmLoggerInfoErr prints request/response data without payloads to stderr

mmLoggerInfoFilterErr :: (LogEvent -> Bool) -> Logger Source #

mmLoggerInfoFilterErr takes a user-defined predicate that it uses to select which events to log before logging them to stderr.

mmLoggerDebugErr :: Logger Source #

mmLoggerDebugErr prints the full data of every logging event to stderr.

mmLoggerDebugFilterErr :: (LogEvent -> Bool) -> Logger Source #

mmLoggerDebugFilterErr takes a user-defined predicate that it uses to select which events to log before logging them to stderr.