-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First attempt at logging to files instead of std out #135
Changes from all commits
f7d35eb
efcfb7e
9b29a75
211533f
447934f
eac7f2e
0235a8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ cabal.sandbox.config | |
.envrc | ||
dist-newstyle/ | ||
result/ | ||
logs/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ import System.Console.GetOpt ( ArgDescr(..) | |
, getOpt | ||
, usageInfo | ||
) | ||
import System.Directory ( createDirectoryIfMissing ) | ||
import System.Environment ( getArgs ) | ||
import System.IO ( stdout ) | ||
import Web.Scotty ( get | ||
|
@@ -54,6 +55,7 @@ opts :: [OptDescr (Config -> Config)] | |
opts = | ||
[ Option [] ["help"] (NoArg (set cHelp True)) "Show usage info" | ||
, Option [] ["port"] (ReqArg (set cPort . read) "PORT") "Port to run on" | ||
, Option [] ["path"] (ReqArg (set cLogPath) "PATH") "Path to save log files to, default is 'logs'" | ||
, Option [] | ||
["interval"] | ||
(ReqArg (set cInterval . (1000000 *) . read) "INTERVAL (s)") | ||
|
@@ -71,6 +73,7 @@ main = (recreateConfig . getOpt Permute opts <$> getArgs) >>= \case | |
(config , _ , _ ) -> do | ||
upd <- newEmptyMVar -- putMVar when to update | ||
viewRef <- createViewReference | ||
createDirectoryIfMissing True (_cLogPath config) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this path relative? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or maybe both? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both absolute and relative that is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It handles both :D 🗡️ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AWESOME! I am now a much calmer human. |
||
|
||
-- In the list there are three items running concurrently: | ||
-- 1. Timer that sends a signal to the updater when it's time to update | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 IT EXISTS FOR REAL! 🎉