-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lwt_log: how can we use it? #468
Comments
@dannywillems, try the code in this post: https://discuss.ocaml.org/t/about-lwt-concurrency-library/150/6: let () =
Lwt_log_core.default :=
Lwt_log.channel
~template:"$(date).$(milliseconds) [$(level)] $(message)"
~close_mode:`Keep
~channel:Lwt_io.stdout
();
Lwt_log_core.add_rule "*" Lwt_log_core.Info;
Lwt_main.run begin
Lwt_log_core.info "blah"
end
(* ocamlfind opt -linkpkg -package lwt.unix foo.ml && ./a.out *) As per that post, you would normally use module |
Also, even if this answers your question, let's leave the issue open to remind about improving the docs. |
@dannywillems Have a look at https://github.com/dbuenzli/logs for a logging solution. It has a better API for logging and isn't Lwt specific. Lwt_log should be deprecated IMO. |
Thanks @rgrinberg and @aantron. Sorry to answer now. |
No worries, most open source takes place at the rate at which people happen to by luck be available :) |
I'm in favor of deprecating I found the docs of @rgrinberg, any thoughts on what to do about |
Ok, I added the example to the module description, stated the relation to |
Seems like it would be easier to just fix it rather than mess around with upper bounds? I agree with splitting the package for the purpose of getting rid of more dotted findlib names. |
Factoring out |
Are there simple examples to use
Lwt_log
to write logs? Do we need to initialize something before usingLwt_log.info "Hello, world!"
?Is it recommended to use it to log lots of information (to
stdout
and in files)?The text was updated successfully, but these errors were encountered: