-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Size-limited, concurrent, automatically-rotating log writer. -- -- Size-limited, concurrent, automatically-rotating log writer. @package rotating-log @version 0.4.2 -- | Convenient logging to a disk-based log file with automatic file -- rotation based on size. module System.RotatingLog -- | A size-limited rotating log. Log filenames are of the format -- prefix_timestamp.log. data RotatingLog -- | Creates a rotating log given a prefix and size limit in bytes. mkRotatingLog :: String -> Word64 -> BufferMode -> (FilePath -> IO ()) -> IO RotatingLog -- | Like "rotatedWrite'", but doesn't need a UTCTime and obtains it with a -- syscall. rotatedWrite :: RotatingLog -> ByteString -> IO () -- | Writes ByteString to a rotating log file. If this write would exceed -- the size limit, then the file is closed and a new file opened. This -- function takes a UTCTime to allow a cached time to be used to avoid a -- system call. -- -- Please note this function does NOT implicitly insert a newline at the -- end of the string you provide. This is so that it can be used to log -- non-textual streams such as binary serialized or compressed content. rotatedWrite' :: RotatingLog -> UTCTime -> ByteString -> IO () -- | Close the underlying file handle and apply the post-action hook. rotatedClose :: RotatingLog -> IO () -- | A built-in post-rotate action that moves the finished file to a given -- archive location. archiveFile :: FilePath -> (FilePath -> IO ())