I used a modified version of the example 2-middleware to test logging, and I couldn't figure out why Dream.debug is not producing any messages even when setting the logging level to Debug.
let () =
Dream.initialize_log ~level:`Debug ();
Dream.run
@@ Dream.logger
@@ fun _ ->
Dream.debug (fun log -> log "hello %s" "world");
Dream.html "Good morning, world!"
If I replace Dream.debug with Dream.info, I see the expected logging message. I also added SQL sessions to check if I get any debug message:
let () =
Dream.initialize_log ~level:`Debug ();
Dream.run
@@ Dream.logger
@@ Dream.sql_pool "sqlite3:test.sqlite"
@@ Dream.sql_sessions
@@ fun _ ->
Dream.debug (fun log -> log "hello %s" "world");
Dream.html "Good morning, world!"
This version produces debug messages describing the queries executed to get sessions, but I still couldn't see my "hello world":
27.02.25 13:37:59.436 Running at http://localhost:8080
27.02.25 13:37:59.436 Type Ctrl+C to stop
27.02.25 13:38:10.657 dream.logger INFO REQ 1 GET / ::1:53645 fd 8 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
27.02.25 13:38:10.660 caqti.request DEBUG REQ 1 Sending (unit -->. unit) {|PRAGMA foreign_keys = ON|}
27.02.25 13:38:10.662 caqti.request DEBUG REQ 1 Sending (string -->? string × float × string) {|SELECT label, expires_at, payload FROM dream_session WHERE id = $1|}
27.02.25 13:38:10.663 dream.logger INFO REQ 1 200 in 6141 μs
Am I missing anything?
I used a modified version of the example
2-middlewareto test logging, and I couldn't figure out whyDream.debugis not producing any messages even when setting the logging level toDebug.If I replace
Dream.debugwithDream.info, I see the expected logging message. I also added SQL sessions to check if I get any debug message:This version produces debug messages describing the queries executed to get sessions, but I still couldn't see my "hello world":
Am I missing anything?