@@ -72,6 +72,19 @@ data ColorStrategy
72mkHandleScribe :: ColorStrategy -> Handle -> PermitFunc -> Verbosity -> IO Scribe
72mkHandleScribe :: ColorStrategy -> Handle -> PermitFunc -> Verbosity -> IO Scribe
73mkHandleScribe = mkHandleScribeWithFormatter bracketFormat
73mkHandleScribe = mkHandleScribeWithFormatter bracketFormat
76+mkFileScribeWithFormatter :: (forall a . LogItem a => ItemFormatter a)
82+mkFileScribeWithFormatter formatter color f permitF verb = do
83+ h <- openBinaryFile f AppendMode
84+ Scribe logger finalizer permit <- mkHandleScribeWithFormatter formatter color h permitF verb
85+ return (Scribe logger (finalizer `finally` hClose h) permit)
75-- | Logs to a file handle such as stdout, stderr, or a file. Takes a custom
88-- | Logs to a file handle such as stdout, stderr, or a file. Takes a custom
76-- `ItemFormatter` that can be used to format `Item` as needed.
89-- `ItemFormatter` that can be used to format `Item` as needed.
@@ -100,10 +113,7 @@ mkHandleScribeWithFormatter itemFormatter cs h permitF verb = do
100-- 'closeScribe'/'closeScribes'. Does not do log coloring. Sets handle
113-- 'closeScribe'/'closeScribes'. Does not do log coloring. Sets handle
101-- to 'LineBuffering' mode.
114-- to 'LineBuffering' mode.
102mkFileScribe :: FilePath -> PermitFunc -> Verbosity -> IO Scribe
115mkFileScribe :: FilePath -> PermitFunc -> Verbosity -> IO Scribe
103−mkFileScribe f permitF verb = do
116+mkFileScribe = mkFileScribeWithFormatter bracketFormat (ColorLog False)
104− h <- openFile f AppendMode
105− Scribe logger finalizer permit <- mkHandleScribe (ColorLog False) h permitF verb
106− return (Scribe logger (finalizer `finally` hClose h) permit)
109-------------------------------------------------------------------------------
119-------------------------------------------------------------------------------