irc-fun-client-0.2.0.0: Another library for writing IRC clients.

Safe HaskellNone
LanguageHaskell2010

Network.IRC.Fun.Client.ChannelLogger

Synopsis

Documentation

logFilePath Source

Arguments

:: FilePath

Directory in which to place log files. Relative to the program's working directory, or absolute.

-> String

Server label, e.g. "freenode"

-> ChannelName

IRC channel name, e.g. "#freepost"

-> FilePath 

Utility for constructing a log file path.

newLogger Source

Arguments

:: IO String

Action which returns a formatted time string. You can use Network.IRC.Fun.Client.Time to create such an action.

-> FilePath

Path of the log file

-> IO Logger 

Create a logger for a given IRC channel.

removeLogger :: Logger -> IO () Source

Flush buffers and release resources.

When the logger is paused for a long period of time (i.e. not momentarily - e.g. by a user disabling channel logging via UI), you can use this to release resources. Later, when logging is needed again, create a fresh new logger.

If your client joins many channels but log few of them, you can save resources by keeping open loggers only for the few logged channels.

logEvent :: Logger -> ChanLogEvent -> IO () Source

Write a log message corresponding to a given event.

fromClientEvent :: Event -> Maybe LogEvent Source

If an IRC client event can be logged, return a matching log event and the channel in which the event has occured.