dbuenzli / logs

Logging infrastructure for OCaml
http://erratique.ch/software/logs
ISC License
87 stars 19 forks source link

provide a basic reporter without dependencies #12

Closed c-cube closed 8 years ago

c-cube commented 8 years ago

I find it annoying that I have to write a reporter myself if I don't use Fmt (and all the fancy stuff associated). Is it possible to get a basic reporter packed in Logs itself?

dbuenzli commented 8 years ago

Could add that yes.

c-cube commented 8 years ago

Do you want me to implement one and make a PR?

dbuenzli commented 8 years ago

Thanks but don't bother it is basically going to be a C&P from https://github.com/dbuenzli/logs/blob/master/src/logs_fmt.ml#L24-L38 with Fmt substitued by Format and Fmt.styled removed. I'll do that later this evening.

dbuenzli commented 8 years ago

In fact rather than c&p it was rearranging code. So Logs.format_reporter behaves exactly like Logs_fmt.reporter except without colored headers and hence without the Fmt dependency. Tell me if that suits you.

c-cube commented 8 years ago

This looks very nice, thanks. It's good that you could avoid duplicating the code, and the API seems quite flexible.

dbuenzli commented 8 years ago

Had a glitch in the defaults, upgrade if pinned. I'll make a minor release in a few days.