companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.14.0 released: https://ocaml.org/releases/4.14.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
Haudegen has quit [Ping timeout: 264 seconds]
Tuplanolla has quit [Quit: Leaving.]
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
waleee has quit [Ping timeout: 244 seconds]
Serpent7776 has quit [Read error: Connection reset by peer]
bobo_ has joined #ocaml
spip has quit [Ping timeout: 248 seconds]
williewi` has joined #ocaml
azimut has joined #ocaml
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
chrisz has quit [Ping timeout: 252 seconds]
chrisz has joined #ocaml
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
williewi` has quit [Quit: ERC 5.4 (IRC client for GNU Emacs 28.1)]
zebrag has joined #ocaml
zebrag has quit [Client Quit]
zebrag has joined #ocaml
zebrag has quit [Client Quit]
zebrag has joined #ocaml
zebrag has quit [Client Quit]
John_Ivan_ has quit [Ping timeout: 252 seconds]
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
olle has joined #ocaml
hrberg has joined #ocaml
wonko_ has joined #ocaml
wonko_ has quit [Ping timeout: 248 seconds]
olle has quit [Ping timeout: 268 seconds]
jlrnick has joined #ocaml
Tuplanolla has joined #ocaml
wonko_ has joined #ocaml
jlrnick has quit [Ping timeout: 264 seconds]
spip has joined #ocaml
bobo_ has quit [Ping timeout: 268 seconds]
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
waleee has joined #ocaml
waleee has quit [Ping timeout: 248 seconds]
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
olle has joined #ocaml
wonko_ has quit [Ping timeout: 264 seconds]
bartholin has joined #ocaml
bartholin has quit [Ping timeout: 252 seconds]
ansiwen has quit [Quit: ZNC 1.7.1 - https://znc.in]
bartholin has joined #ocaml
ansiwen has joined #ocaml
wonko_ has joined #ocaml
Serpent7776 has joined #ocaml
jlrnick has joined #ocaml
jlrnick has quit [Ping timeout: 244 seconds]
wonko_ has quit [Ping timeout: 244 seconds]
adanwan has quit [Ping timeout: 258 seconds]
adanwan has joined #ocaml
adanwan has quit [Remote host closed the connection]
adanwan has joined #ocaml
wonko_ has joined #ocaml
wonko_ has quit [Ping timeout: 244 seconds]
ansiwen has quit [Quit: ZNC 1.7.1 - https://znc.in]
ansiwen has joined #ocaml
ansiwen has quit [Client Quit]
John_Ivan_ has joined #ocaml
ansiwen has joined #ocaml
wonko_ has joined #ocaml
bartholin has quit [Ping timeout: 244 seconds]
jlrnick has joined #ocaml
wonko_ has quit [Ping timeout: 244 seconds]
jlrnick has quit [Ping timeout: 248 seconds]
bartholin has joined #ocaml
bartholin has quit [Ping timeout: 252 seconds]
bartholin has joined #ocaml
John_Ivan_ has quit [Read error: Connection reset by peer]
John_Ivan has joined #ocaml
bobo_ has joined #ocaml
spip has quit [Ping timeout: 268 seconds]
szkl has quit [Quit: Connection closed for inactivity]
oriba has joined #ocaml
wonko_ has joined #ocaml
<olle> Did I already ask about good logging tool? For tracing
<olle> volt?
zebrag has joined #ocaml
<olle> The packages you requested declare the following system dependencies. Please make sure they are installed before retrying: camlp4-extra
<olle> but
<olle> [ERROR] No package named camlp4-extra found.
<olle> ?
<olle> dolog installs
<olle> But how to I log to file...?
<hannes> olle: I'm pretty happy with "logs" (and logs-syslog if you've a syslog sink in production)
<olle> hannes: k
<olle> hannes: trying out dolog now :)
tizoc has quit [Quit: Coyote finally caught me]
wonko_ has quit [Ping timeout: 268 seconds]
tizoc has joined #ocaml
<companion_cube> just use `logs`
<olle> companion_cube: what's that?
<olle> third on the list :|
<companion_cube> like hannes said, it's the library you should use
<companion_cube> I don't think that's an ordered list…
<olle> well, what the hell is it? because it's top google
<companion_cube> just a list
<olle> speaking of "maturity of eco-system" xD
<companion_cube> I'm making a PR to put it first :p
<olle> +1
<olle> Yeah, not getting the results I'm expecting with dolog, sigh, moving to logs, thanks
<companion_cube> https://opam.ocaml.org/packages/logs/ look at "required by"
<olle> Right
<olle> Error: Unknown package logs!
<olle> :(
<olle> dune: unknown command `search'.
<companion_cube> it's in opam
<companion_cube> opam search logs
<companion_cube> opam install logs
<olle> wait
<olle> I'm an idiot
<olle> Of course haha
<olle> Ehrm, seems a bit complex
<olle> Each log requires a lambda? o0
<olle> Easy enough to alias, I guess
<companion_cube> it's for perf reasons, it works very nicely
<companion_cube> Logs.err (fun m->m "oh no %d" 42);
<olle> Error: Unbound module Fmt_tty
<olle> Example is not complete
<companion_cube> there are optional deps, did you install `fmt`?
<companion_cube> the simpler example is to just use `Logs.format_reporter()` iirc
<olle> Yeah, they need one of those haha
<olle> Hmmm
<olle> I'm including fmt in dune, but
<olle> Error: No implementations provided for the following modules: Fmt_tty referenced from lib/pholyglot.cmxa(Pholyglot__Test)
<olle> Gonna google that
<companion_cube> "logs.fmt" I think
<companion_cube> oh wait, that's the docs of `Logs_cli`, maybe it's a side library too.
<companion_cube> you need logs.cli in your dune file, most likely
<olle> Error: Library "logs.cli" in /home/olle/.opam/default/lib/logs is hidden
<olle> Hidden?
<companion_cube> it might also require cmdliner
<companion_cube> bunzli like these optional deps, ugh
<olle> Testing
<olle> including cmdliner still gives the fmt_tty error :d
<olle> Works now, thanks to a reported issue
<olle> Term.(const setup_log $ Fmt_cli.style_renderer () $ Logs_cli.level ())
<olle> What even is this
<olle> What's const?
<olle> Is $ same as |> ?
<olle> Gah
<olle> Back to dolog it is, %$#$%#$%#$%$
<olle> Fuck logs
* olle should pay more attention to the emotional regulation video in the background...
<sim642> companion_cube, I haven't used logs, immediately thought about ppx-ing that and of course there are ppxs for that
<sim642> But actually I think one could do even better
<olle> sim642: which ppx?
<sim642> olle, logs-ppx, but it won't help you set things up, just write that one logging line slightly neater
<sim642> Anyway, I think it'd be possible to write a logging library that on its own doesn't try to be super efficient and does formatting without the closure
<olle> ah k
<sim642> But have a ppxlib special_function ppx to rewrite such function calls into other function calls that use the closure
<sim642> Or even something inlined
<sim642> The beauty would be that the same code works with and without the ppx
<sim642> But if you want performance, you just use the ppx with no code change
<sim642> I might do this in a project of mine which has its own tracing stuff anyway, but always under a stupid "if M.tracing then M.trace ..." guard
<olle> Who cares about performance? If you don't want logging you'll just turn it off?
<olle> What am I missing?
<sim642> it's the turning off part
<sim642> If you just have "log ..." then that function will always get called
<sim642> And if you use more involved pretty-printing inside that, then all of that also
<sim642> That's eager evaluation for you
<olle> That makes sense, yes
<olle> Thanks :)
<olle> Yep, managed to solve the bug with the logging finally
<olle> Phew
John_Ivan has quit [Read error: Connection reset by peer]
azimut has quit [Ping timeout: 258 seconds]
John_Ivan has joined #ocaml
waleee has joined #ocaml
wonko_ has joined #ocaml
wonko_ has quit [Ping timeout: 248 seconds]
bartholin has quit [Quit: Leaving]
wingsorc has joined #ocaml
Haudegen has joined #ocaml
bobo_ has quit [Ping timeout: 252 seconds]
bobo_ has joined #ocaml
Serpent7776 has quit [Ping timeout: 244 seconds]
daimrod1 has quit [Ping timeout: 268 seconds]
daimrod1 has joined #ocaml
olle has quit [Ping timeout: 268 seconds]
wingsorc has quit [Quit: Leaving]
wingsorc has joined #ocaml
Tuplanolla has quit [Ping timeout: 264 seconds]