caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Daniil Baturin <daniil@baturin.org>
To: caml-list@inria.fr
Subject: Re: [Caml-list] A question about Ocaml logging
Date: Tue, 10 Jan 2017 02:13:04 +0700	[thread overview]
Message-ID: <b90f7bb8-3bfa-c849-a376-87cd18d22001@baturin.org> (raw)
In-Reply-To: <2383491.giY4FN1y6Q@twitter>


[-- Attachment #1.1: Type: text/plain, Size: 2172 bytes --]

Hi Chet,

Have you looked into the logging modules from Lwt? While they work best
for those who already use Lwt,
and they definitely have their shortcoming, on the plus side the log
statements are very concise,
you can set the log level and add logging rules at runtime, and it has
file and syslog logging out of the box.


On 01/10/2017 01:52 AM, Chet Murthy wrote:
> All,
>
> I hope this is the right place to ask this question.  I've been
> writing a nontrivial distributed system (well, a number of them over
> the last few years) and have had need of a robust and flexible logging
> framework.  Specifically, I've been using "bolt" and its descendant,
> "volt", which provide camlp4 syntax extensions.  These extensions make
> the syntax of the logging statements significantly less verbose, and
> that in itself ia a valuable thing.
>
> With the arrival of ppx rewriters, I realize that the camlp4/camlp5
> method of adding syntax to ocaml is deprecated.  So I wonder: is there
> some really good logging toolkit out there, that I've overlooked.
>
> I'm aware of a number of different packages, but only bolt/volt have
> syntax extensions, and it's my belief that they're essential to making
> effortless pervasive log-line instrumentation.
>
> But perhaps I just haven't looked hard enough ....  So .... before I
> go write my own, I figured I'd ask the list if there were such a
> thing.
>
> For concreteness, the basic thing I'm looking for, is a syntax
> extension that somewhat resembles
>
>   LOG "%s" appid LEVEL DEBUG ;
>
> which expands out to code something like
>
> begin
>   if log_enabled <current-module/function-path-as-string> DEBUG then
>     log (Printf.sprintf "%s" appid)
> end
>
> I hate writing "slight variations on somebody else's good idea", so
> would much prefer to "improve" somebody else's library/tool, than come
> up with my own.
>
> Thanks in advance,
> --chet--
>
>


-- 
#!/usr/bin/env perl
@a=split(//, "daniil @ baturin  .  org" );# Daniil Baturin
@b=split(//,q/Px%!+o0Q6lh*7dp$.@8#%|y{/);while($i<24){$_.=
chr((ord(@b[$i])-ord(@a[$i])+62)%94+32);$i++};print"$_\n"#



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 847 bytes --]

  reply	other threads:[~2017-01-09 19:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-09 18:52 Chet Murthy
2017-01-09 19:13 ` Daniil Baturin [this message]
2017-01-09 19:41 ` Hugo Herbelin
2017-01-16 15:14 ` Anil Madhavapeddy
2017-01-17 11:52   ` Jesper Louis Andersen
2017-01-17 19:20     ` Malcolm Matalka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b90f7bb8-3bfa-c849-a376-87cd18d22001@baturin.org \
    --to=daniil@baturin.org \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).