creatur-5.9.30: Framework for artificial life experiments.
Copyright(c) 2011-2021 Amy de Buitléir
LicenseBSD-style
Maintaineramy@nualeargais.ie
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

ALife.Creatur.Logger.SimpleRotatingLogger

Description

A simple rotating log, tailored to the needs of the Créatúr framework.

Synopsis

Documentation

class Logger l where Source #

Methods

writeToLog :: String -> StateT l IO () Source #

writeToLog msg formats and writes a new log message.

mkSimpleRotatingLogger :: FilePath -> String -> Int -> SimpleRotatingLogger Source #

mkSimpleRotatingLogger d prefix n creates a logger that will write to directory d. 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.