webapp: Avoid encoding problems when displaying the daemon log file.
This commit is contained in:
parent
09abd29469
commit
b7c15f3b60
3 changed files with 8 additions and 1 deletions
|
@ -67,5 +67,9 @@ getLogR :: Handler Html
|
|||
getLogR = page "Logs" Nothing $ do
|
||||
logfile <- liftAnnex $ fromRepo gitAnnexLogFile
|
||||
logs <- liftIO $ listLogs logfile
|
||||
logcontent <- liftIO $ concat <$> mapM readFile logs
|
||||
logcontent <- liftIO $ concat <$> mapM readlog logs
|
||||
$(widgetFile "control/log")
|
||||
where
|
||||
readlog f = withFile f ReadMode $ \h -> do
|
||||
fileEncoding h -- log may contain invalid utf-8
|
||||
hClose h `after` hGetContentsStrict h
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue