add the ability to configure logger

This commit is contained in:
zapashcanon 2022-02-19 22:29:17 +01:00
parent 866b78f1f4
commit 23e0add29d
No known key found for this signature in database
GPG key ID: 8981C3C62D1D28F1
2 changed files with 14 additions and 1 deletions

View file

@ -246,7 +246,8 @@ let routes =
[ get_ "/:thread_id" thread_get; post "/:thread_id" reply_post ]
let () =
Dream.run ~port:App.port @@ Dream.logger @@ Dream.cookie_sessions
let logger = if App.log then Dream.logger else Fun.id in
Dream.run ~port:App.port @@ logger @@ Dream.cookie_sessions
(* this should replace memory/cookie sessions but it doesn't work :-(
@@ Dream.sql_pool Db.db_uri
@@ Dream.sql_sessions