attempt to move lwt.log into separate lwt_log#484
Conversation
|
I'm not sure in how many packages lwt should be split -- the log sublibrary is used by both |
|
There seem to be two kinds of interactions between
For (1), I see only two trivial logging expressions (in |
|
In summary, I'd be happy to get the process that this PR would start, actually started, assuming we can figure out what to do about |
|
|
|
Yeah, factoring out I really don't like the idea of creating new packages just to deprecate them, or factoring out a package with one module that has one function, but I can't think of anything better.. and it will do the trick. |
|
What's slowing me down right now is that I think |
|
I looked through opam packages depending on Lwt, and found:
So cc @toolslive, @domsj, @mseri, @gaborigloi, @fxfactorial, @djs55, @zshipko for any opinions on gently moving A large number of packages depend on The plan would be:
There is one more complication, which is that the PPX and the Camlp4 syntax have some support for |
lwt_log.opam
Outdated
| "Anton Bachin <antonbachin@yahoo.com>" | ||
| ] | ||
| authors: [ | ||
| "Gabriel Radanne" |
|
What's the purpose of spliting lwt_log out ? I doesn't really bring extra dependencies or anything, and it's not like it's difficult to build. |
|
@Drup, to deprecate it and encourage use of |
|
The "broader" picture is I'd be happy to see work on |
|
Another point to move daemonization to its own package is that it really shouldn't be encouraged either. It doesn't really serve a purpose when you have a modern init system http://blog.benoitblanchon.fr/linux-daemon-considered-harmful/ |
|
It seems to also be deprecated on macOS, but I'm not sure about "obscure" systems. |
This sounds like an excellent approach to me. When |
|
Your plan makes perfect sense and I welcome the split and the cleanup. We use the daemon and the logs in few places but somewhat inconsistenly. We have one more package that is using |
|
@avsm @rgrinberg What libraries would you recommend as daemonising alternatives on linux? We are using |
|
You don't need any libraries, or daemonization for that matter. Just write
a systemd service file that uses your binary. This process isn't in any way
unique to ocaml so there's not much to even document for us.
…On Fri, Oct 20, 2017, 9:58 PM Marcello Seri ***@***.***> wrote:
@avsm <https://github.com/avsm> @rgrinberg <https://github.com/rgrinberg>
What libraries would you recommend as daemonising alternatives on linux? We
are using ocaml-systemd in some places, but we couldn't use it everywhere
due to undebuggable segfaults in some cases
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#484 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAIe-yU9YaJ5HZPtfgCTcDzBBF-NkMkWks5suKbrgaJpZM4P5Yy2>
.
|
Lwt_log will be factored out of Lwt in the coming releases. Lwt_log was used by the rest of Lwt in three places: - Lwt_preemptive mentioned Lwt_log, but never actually logged anything. - Lwt_timeout used Lwt_log in a default handler for unhandled exceptions occurring after a timeout exception has already been raised. This default handler printed to the error log, then terminated the process with non-zero exit status. That behavior has been replaced by calling !Lwt.async_exception_hook, whose default behavior is to print to STDERR, then also terminate the process with non-zero exit status. - Lwt_daemon uses Lwt_log in its API, but daemonization is deprecated, and Lwt_daemon will be factored out at the same time as Lwt_log. See #484 (comment) and subsequent comments. Part of work being discussed in #484.
Also a few other nits.
This reflects the split in the logger in package lwt: lwt.log contains only Lwt_log_core and Lwt_log_rules. Lwt_log is in lwt.unix.
|
Ok, I rebased this PR (there was a merge conflict). I added more commits, such that:
If there are no objections, I will squash-merge this (so @hannesm will be the author, I will be the committer, and there will be a link from the commit message to this PR for the details). That will be the first step of factoring out In a previous commit, 4a7cf8c, now in |
|
@aantron thanks for taking care of that! highly appreciated! |
|
Actually, I think it's better to eliminate |
this is a first attempt to move lwt.log into its own package, so for a 4.0 release it can really be split. please let me know what you think.