diff --git a/src/System/RotatingLog.hs b/src/System/RotatingLog.hs index fafaf2c..158d249 100644 --- a/src/System/RotatingLog.hs +++ b/src/System/RotatingLog.hs @@ -48,7 +48,7 @@ data LogInfo = LogInfo logFileName :: String -> UTCTime -> FilePath logFileName pre t = concat - [pre, "_", formatTime defaultTimeLocale "%F_%T%Q" t, ".log"] + [pre, "_", formatTime defaultTimeLocale "%Y_%m_%d_%H_%M_%S.%Q" t, ".log"] ------------------------------------------------------------------------------ -- | Creates a rotating log given a prefix and size limit in bytes. @@ -103,7 +103,7 @@ archiveFile :: FilePath -- ^ A target archive directory -> (FilePath -> IO ()) -archiveFile fp archive = +archiveFile archive fp = let (dir, fn) = splitFileName fp target = archive fn in do diff --git a/test/TestRotate.hs b/test/TestRotate.hs index d0ffc4e..ce3f52c 100644 --- a/test/TestRotate.hs +++ b/test/TestRotate.hs @@ -13,7 +13,7 @@ thread log pre n = do thread log pre (n+1) main = do - log <- mkRotatingLog "foo" 1000000 (const $ return ()) + log <- mkRotatingLog "foo" 1000000 (archiveFile "logs") a <- forkIO $ thread log "a" 0 b <- forkIO $ thread log "b" 0 c <- forkIO $ thread log "c" 0