use logs + add static.ml + fmt

This commit is contained in:
swrup 2025-11-29 19:36:35 +01:00
parent ad648178ab
commit cf4da6b382
15 changed files with 246 additions and 196 deletions

View file

@ -16,7 +16,9 @@ let db_connection : (env, Caqti_miou.connection) Vif.Device.device =
match Pg.preflight conn with
| Error err ->
Fmt.failwith "Database preflight failure: %a." Caqti_error.pp err
| Ok () -> conn)
| Ok () ->
Logs.info (fun m -> m "database connection initialized");
conn)
module Secmod_signkey = struct
(* TODO
@ -70,8 +72,11 @@ module Secmod_signkey = struct
match load conn with
| Ok None ->
let t = generate_fresh_secmod_data () in
Logs.info (fun m -> m "secmod_signkey initialized with fresh keys");
t
| Ok (Some v) -> v
| Ok (Some v) ->
Logs.info (fun m -> m "secmod_signkey initialized from storage");
v
| Error _ ->
(* TODO error: pretty print *)
Fmt.failwith "secmod_signkey init failure."
@ -131,8 +136,11 @@ module Secmod_denom = struct
match load conn with
| Ok None ->
let t = generate_fresh_secmod_data () in
Logs.info (fun m -> m "secmod_denom initialized with fresh keys");
t
| Ok (Some v) -> v
| Ok (Some v) ->
Logs.info (fun m -> m "secmod_denom initialized from storage");
v
| Error _ -> Fmt.failwith "secmod_denom init failure."
end