Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Structured Logging #7

Closed
tpolecat opened this issue Aug 14, 2014 · 4 comments
Closed

Structured Logging #7

tpolecat opened this issue Aug 14, 2014 · 4 comments
Milestone

Comments

@tpolecat
Copy link
Member

Add exception-proof structured logging that can produce usable traces like this. Need to have sliding windows or something to prevent unbounded trace growth. This will require messing with the Kleisli interpreters or adding additional ones.

@tpolecat tpolecat added this to the 0.3.0 milestone Dec 22, 2014
@tpolecat
Copy link
Member Author

Consider the following.

trait Monitor {
  def gosub[F[_]: Monad: Capture: Catchable, A](fa: F[A])(target: Any): F[A]
  def call[F[_]: Monad: Capture: Catchable, A](fa: F[A])(method: String, args: Array[Any]): F[A]
}

and then primitive combinator

case class WithMonitor[A](fa: WoozleIO[A], m: Monitor) extends WoozleOp[A]

and syntax

prog.withMonitor(m)

This will require a second interpreter that handles monitoring, or a default no-op monitor, or an optional one. Fiddly.

@aloiscochard
Copy link

@tpolecat I'm surprised you need a Capture constrain if you already have Monad?

I suppose you don't want to capture effect using return/pure?

@tpolecat
Copy link
Member Author

Right, that's the only reason Capture exists. We need a way to capture effects in any potential monad. A logger might want to know what time it is, or write to a file, etc.

@tpolecat tpolecat removed this from the 0.3.0 milestone Aug 11, 2016
@tpolecat tpolecat modified the milestone: Backlog Nov 17, 2016
@jatcwang
Copy link
Collaborator

jatcwang commented Jan 7, 2024

LogHandler should support this already

@jatcwang jatcwang closed this as completed Jan 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants