Lwt_log "module" (is it really a module?) in lambda-term package

In the source code for the lambda-term package, there is a file called lTerm_widget_callbacks.ml (at https://github.com/ocaml-community/lambda-term/blob/master/src/lTerm_widget_callbacks.ml) that starts as follows :

 * lTerm_widget_callbacks.ml
 * ---------------
 * Copyright : (c) 2011, Jeremie Dimino <jeremie@dimino.org>
 * Licence   : BSD3
 * This file is a part of Lambda-Term.

let section = Lwt_log.Section.make "lambda-term(widget_callbacks)"

My problem is, that I can’t really figure out how this Lwt_log module is constructed. There is no lwt_log.ml file in the source for Lwt or lambda-term, so it seems that this module is not constructed the usual way.

In https://github.com/ocsigen/lwt/blob/master/src/ppx/ppx_lwt.ml I see a code snippet as follows :

   [Lwt_log.error "message"] ≡
   [let __pa_log_section = Lwt_log.Section.main in
   if Lwt_log.Error >= (Lwt_log.Section.level __pa_log_section)
   then Lwt_log.error ~location:("foo.ml", 1, 0) ~section:__pa_log_section "message"
   else Lwt.return_unit];
   [Lwt_log.error ~section "message"] ≡
   [let __pa_log_section = section in ...].
   Additionally, remove debug-level statements if -no-debug is given. **)
let lwt_log mapper fn args attrs loc =

Which makes me think that ppx is involved.

Can I somehow “translate” the parts of the code that use this Lwt_log module to more “elementary” OCaml code not relying on ppx ?

Lwt_log has been removed from lwt (in favour of the logs library). You can look at the old lwt sources or at https://github.com/ocsigen/lwt_log

1 Like

If it’s been removed, how come it still appears in today’s version of the github repo for lambda-term ? Does that mean that this part of the lambda-term package uses a deprecated package ?

It is explicitly mentioned as a dependency: https://github.com/ocaml-community/lambda-term/blob/master/lambda-term.opam#L14

1 Like

Indeed, I missed that. Thanks for your kind help