Skip to content

Commit

Permalink
Merge pull request #384 from emillon/logs-lwt
Browse files Browse the repository at this point in the history
Use logs.lwt instead of lwt_logs
  • Loading branch information
emillon authored Jul 5, 2022
2 parents 2569162 + 6c55ea7 commit 8e74888
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
(wrapped false)
(flags :standard -safe-string)
(modes byte)
(libraries compiler-libs.toplevel findlib.top lambda-term threads zed)
(libraries compiler-libs.toplevel findlib.top lambda-term logs.lwt threads zed)
(preprocess
(action
(run %{bin:cppo} -V OCAML:%{ocaml_version} %{input-file}))))
Expand Down
10 changes: 5 additions & 5 deletions src/lib/uTop_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ let save_history () =
?max_entries:!UTop.history_file_max_entries fn)
(function
| Unix.Unix_error (error, func, arg) ->
Lwt_log.error_f "cannot save history to %S: %s: %s" fn func (Unix.error_message error)
Logs_lwt.err (fun m -> m "cannot save history to %S: %s: %s" fn func (Unix.error_message error))
| exn -> Lwt.fail exn)

let init_history () =
Expand All @@ -68,8 +68,8 @@ let init_history () =
(fun () -> LTerm_history.load UTop.history fn)
(function
| Unix.Unix_error (error, func, arg) ->
Lwt_log.error_f "cannot load history from %S: %s: %s"
fn func (Unix.error_message error)
Logs_lwt.err (fun m -> m "cannot load history from %S: %s: %s"
fn func (Unix.error_message error))
| exn -> Lwt.fail exn)

(* +-----------------------------------------------------------------+
Expand Down Expand Up @@ -1590,9 +1590,9 @@ let load_inputrc () =
LTerm_inputrc.load
(function
| Unix.Unix_error (error, func, arg) ->
Lwt_log.error_f "cannot load key bindings from %S: %s: %s" LTerm_inputrc.default func (Unix.error_message error)
Logs_lwt.err (fun m -> m "cannot load key bindings from %S: %s: %s" LTerm_inputrc.default func (Unix.error_message error))
| LTerm_inputrc.Parse_error (fname, line, msg) ->
Lwt_log.error_f "error in key bindings file %S, line %d: %s" fname line msg
Logs_lwt.err (fun m -> m "error in key bindings file %S, line %d: %s" fname line msg)
| exn -> Lwt.fail exn)

let protocol_version = 1
Expand Down
2 changes: 1 addition & 1 deletion src/lib/uTop_styles.ml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ let load () =
| Unix.Unix_error(Unix.ENOENT, _, _) ->
return ()
| Unix.Unix_error (error, func, _arg) ->
Lwt_log.error_f "cannot load styles from %S: %s: %s" fn func (Unix.error_message error)
Logs_lwt.err (fun m -> m "cannot load styles from %S: %s: %s" fn func (Unix.error_message error))
| exn -> Lwt.fail exn)

let stylise_filter_layout stylise tokens =
Expand Down
1 change: 1 addition & 0 deletions utop.opam
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ depends: [
"base-threads"
"ocamlfind" {>= "1.7.2"}
"lambda-term" {>= "3.1.0" & < "4.0"}
"logs"
"lwt"
"lwt_react"
"zed" { >= "3.2.0" }
Expand Down

0 comments on commit 8e74888

Please sign in to comment.