Open steinybot opened 1 week ago
It would be nice to have a bit more control over whether the result of run in a KyoApp gets logged or not.
run
KyoApp
Perhaps something simple like if it returns Unit then don't log it. Otherwise some flag that can be overriden.
Unit
I could override handle but that seems a bit heavy handed.
handle
It is especially annoying when there is a resource release that logs when it is done such as:
run { for { _ <- Consoles.println(s"Server is running on port $port. Press Ctrl-C to stop.") server <- Resources.acquireRelease(IOs(buildServer(port, services).start())) { (server: Server) => for { _ <- Consoles.run(Consoles.print("Shutting down...")) _ <- IOs(server.shutdown().awaitTermination()) _ <- Consoles.run(Consoles.println("Done.")) } yield () } s <- waitForInterrupt } yield "Goodbye!" }
Which will log:
Server is running on port 9001. Press Ctrl-C to stop. Goodbye! Shutting down...Done.
Instead of:
Server is running on port 9001. Press Ctrl-C to stop. Shutting down...Done. Goodbye!
Maybe I shouldn't be logging in the release but there aren't many options.
It would be nice to have a bit more control over whether the result of
run
in aKyoApp
gets logged or not.Perhaps something simple like if it returns
Unit
then don't log it. Otherwise some flag that can be overriden.I could override
handle
but that seems a bit heavy handed.It is especially annoying when there is a resource release that logs when it is done such as:
Which will log:
Instead of:
Maybe I shouldn't be logging in the release but there aren't many options.