@@ -72,6 +72,19 @@ data ColorStrategy
7272mkHandleScribe :: ColorStrategy -> Handle -> PermitFunc -> Verbosity -> IO Scribe
7373mkHandleScribe = mkHandleScribeWithFormatter bracketFormat
7474
75+
76+mkFileScribeWithFormatter :: (forall a . LogItem a => ItemFormatter a)
77+ -> ColorStrategy
78+ -> FilePath
79+ -> PermitFunc
80+ -> Verbosity
81+ -> IO Scribe
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)
86+
87+
7588-- | Logs to a file handle such as stdout, stderr, or a file. Takes a custom
7689-- `ItemFormatter` that can be used to format `Item` as needed.
7790--
@@ -100,10 +113,7 @@ mkHandleScribeWithFormatter itemFormatter cs h permitF verb = do
100113-- 'closeScribe'/'closeScribes'. Does not do log coloring. Sets handle
101114-- to 'LineBuffering' mode.
102115mkFileScribe :: FilePath -> PermitFunc -> Verbosity -> IO Scribe
103−mkFileScribe f permitF verb = do
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)
116+mkFileScribe = mkFileScribeWithFormatter bracketFormat (ColorLog False)
107117
108118
109119-------------------------------------------------------------------------------