Created
November 29, 2019 15:47
-
-
Save robotmay/2c93c59f2e51b7c5da7e011e4c21e37d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 <40>1 2012-11-30T06:45:29+00:00 host app web.3 - State changed from starting to up | |
119 <40>1 2012-11-30T06:45:26+00:00 host app web.3 - Starting process with command `bundle exec rackup config.ru -p 24405` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Log = Log | |
{ size :: Int | |
, time :: Text | |
, message :: Text | |
} deriving (Eq, Show) | |
pLog :: Parser Log | |
pLog = do | |
notFollowedBy eof | |
size <- L.decimal <?> "size" | |
void (char ' ') | |
void (char '<') | |
void (some alphaNumChar) | |
void (char '>') | |
void alphaNumChar | |
void (char ' ') | |
time <- Text.pack <$> someTill anySingle (char ' ') <?> "time" | |
message <- takeRest <?> "message" | |
return Log {..} | |
pLogs :: Parser (Vector Log) | |
pLogs = do | |
logs <- sepBy1 pLog eol | |
eof | |
return $! Vector.fromList logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Right [Log {size = 83, time = "2012-11-30T06:45:29+00:00", message = "host app web.3 - State changed from starting to up\n119 <40>1 2012-11-30T06:45:26+00:00 host app web.3 - Starting process with command `bundle exec rackup config.ru -p 24405`"}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment