Copyright | (c) 2011-2021 Amy de Buitléir |
---|---|
License | BSD-style |
Maintainer | amy@nualeargais.ie |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
A simple rotating log, tailored to the needs of the Créatúr framework.
Synopsis
- class Logger l where
- writeToLog :: String -> StateT l IO ()
- data SimpleRotatingLogger
- mkSimpleRotatingLogger :: FilePath -> String -> Int -> SimpleRotatingLogger
Documentation
writeToLog :: String -> StateT l IO () Source #
formats and writes a new log message.writeToLog
msg
Instances
Logger SimpleRotatingLogger Source # | |
Defined in ALife.Creatur.Logger.SimpleRotatingLogger writeToLog :: String -> StateT SimpleRotatingLogger IO () Source # | |
Logger SimpleLogger Source # | |
Defined in ALife.Creatur.Logger.SimpleLogger writeToLog :: String -> StateT SimpleLogger IO () Source # |
data SimpleRotatingLogger Source #
A rotating logger.
Instances
Eq SimpleRotatingLogger Source # | |
Defined in ALife.Creatur.Logger.SimpleRotatingLogger (==) :: SimpleRotatingLogger -> SimpleRotatingLogger -> Bool # (/=) :: SimpleRotatingLogger -> SimpleRotatingLogger -> Bool # | |
Show SimpleRotatingLogger Source # | |
Defined in ALife.Creatur.Logger.SimpleRotatingLogger showsPrec :: Int -> SimpleRotatingLogger -> ShowS # show :: SimpleRotatingLogger -> String # showList :: [SimpleRotatingLogger] -> ShowS # | |
Logger SimpleRotatingLogger Source # | |
Defined in ALife.Creatur.Logger.SimpleRotatingLogger writeToLog :: String -> StateT SimpleRotatingLogger IO () Source # |
mkSimpleRotatingLogger :: FilePath -> String -> Int -> SimpleRotatingLogger Source #
creates a logger that will write to
directory mkSimpleRotatingLogger
d prefix nd
. The log "rotates" (starts a new log file) every n
records. Log files follow the naming convention prefix
.k, where k
is the number of the last log record contained in the file. If logging
has already been set up in directory
, then logging will continue where
it left off; appending to the most recent log file.