Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data FileLogSpec = FileLogSpec {}
- data TimedFileLogSpec = TimedFileLogSpec {
- timed_log_file :: FilePath
- timed_timefmt :: TimeFormat
- timed_same_timeframe :: FormattedTime -> FormattedTime -> Bool
- timed_post_process :: FilePath -> IO ()
- check :: FilePath -> IO ()
- rotate :: FileLogSpec -> IO ()
- prefixTime :: FormattedTime -> FilePath -> FilePath
Documentation
data FileLogSpec Source #
The spec for logging files
FileLogSpec | |
|
data TimedFileLogSpec Source #
The spec for time based rotation. It supports post processing of log files. Does not delete any logs. Example:
timeRotate fname = LogFileTimedRotate (TimedFileLogSpec fname timeFormat sametime compressFile) defaultBufSize where timeFormat = "%FT%H%M%S" sametime = (==)on
C8.takeWhile (/=T
) compressFile fp = void . forkIO $ callProcess "tar" [ "--remove-files", "-caf", fp <> ".gz", fp ]
TimedFileLogSpec | |
|
rotate :: FileLogSpec -> IO () Source #
Rotating log files.
prefixTime :: FormattedTime -> FilePath -> FilePath Source #
Prefix file name with formatted time