summaryrefslogtreecommitdiff
path: root/2025/ocaml/lib/application
diff options
context:
space:
mode:
authorDJ O'Leary <dijitol@proton.me>2025-12-05 01:50:42 +0100
committerDJ O'Leary <dijitol@proton.me>2025-12-05 01:50:42 +0100
commit58d165a4156336473a9f8bbe0f55823d0b973fc2 (patch)
tree47d6f3d611200a9b838c6d1b7cdbd72c2eab9220 /2025/ocaml/lib/application
parent88aa00426ab84062b74156649506c7f65233c9c8 (diff)
feat(logger): implement logger functor
still needs to be injected somehow
Diffstat (limited to '2025/ocaml/lib/application')
-rw-r--r--2025/ocaml/lib/application/logger.ml39
1 files changed, 39 insertions, 0 deletions
diff --git a/2025/ocaml/lib/application/logger.ml b/2025/ocaml/lib/application/logger.ml
new file mode 100644
index 0000000..3d63201
--- /dev/null
+++ b/2025/ocaml/lib/application/logger.ml
@@ -0,0 +1,39 @@
+module type LoggerType = sig
+ type 'a t
+
+ val app : 'a t -> unit
+
+ val err : 'a t -> unit
+
+ val warn : 'a t -> unit
+
+ val info : 'a t -> unit
+
+ val debug : 'a t -> unit
+end
+
+module type S = sig
+ type 'a t
+
+ val app : 'a t -> unit
+
+ val err : 'a t -> unit
+
+ val warn : 'a t -> unit
+
+ val info : 'a t -> unit
+
+ val debug : 'a t -> unit
+end
+
+module Make (Logger : LoggerType) : S with type 'a t := 'a Logger.t = struct
+ let app = Logger.app
+
+ let err = Logger.err
+
+ let warn = Logger.warn
+
+ let info = Logger.info
+
+ let debug = Logger.debug
+end