Documentation ¶
Overview ¶
Package api contains the interface that Lucifer uses to talk to the outside world.
This includes LogDog-aware logging (e.g., support for steps even if LogDog is unavailable) and metrics.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides the interface that Lucifer uses to talk to the outside world.
Client tracks the current/last LogDog step that was created. If LogDog steps are created or closed in an unusual order, the behavior of this current step tracking is undefined. Note that LogDog is synchronous and cannot handle this anyway. See the logdog package for details on this behavior.
Example (Step_tracking) ¶
lg := logdog.NewTextLogger(os.Stdout) logdog.ConfigForTest(lg) c := Client{ logger: lg, } s := c.Step("step1") defer s.Close() func(c *Client) { s := c.Step("substep2") defer s.Close() func(c *Client) { s := c.Step("substep3") defer s.Close() }(c) func(c *Client) { s := c.Step("substep4") defer s.Close() }(c) }(&c)
Output: example: STEP step1 example: STEP step1::substep2 example: STEP step1::substep2::substep3 example: STEP step1::substep2::substep3 OK example: STEP step1::substep2::substep4 example: STEP step1::substep2::substep4 OK example: STEP step1::substep2 OK example: STEP step1 OK
Click to show internal directories.
Click to hide internal directories.