Spandex v1.2.8 Spandex.Logger View Source

Passes arguments on to the default logger, but wraps those calls in spans. When functions are provided, it wraps those functions in spans as well.

Link to this section Summary

Functions

Mirrors calls to Logger.debug/2, but spans the calls

Mirrors calls to Logger.error/2, but spans the calls

Mirrors calls to Logger.info/2, but spans the calls

Mirrors calls to Logger.warn/2, but spans the calls

Link to this section Functions

Link to this macro debug(resource, fun, metadata \\ []) View Source (macro)

Mirrors calls to Logger.debug/2, but spans the calls

The first argument: resource, is used to aggregate the data in trace tools, and sets the resource of the span. This also prepends the resource passed in to the message of your logs. This is made inexpensive by use of iolists, as opposed to actual string appending operations.

NOTICE

  • Only accepts functions as its second parameter.
  • Does NOT run the provided function if the log level does not line up, unlike the normal logger
Link to this macro error(resource, fun, metadata \\ []) View Source (macro)

Mirrors calls to Logger.error/2, but spans the calls

The first argument: resource, is used to aggregate the data in trace tools, and sets the resource of the span. This also prepends the resource passed in to the message of your logs. This is made inexpensive by use of iolists, as opposed to actual string appending operations.

NOTICE

  • Only accepts functions as its second parameter.
  • Does NOT run the provided function if the log level does not line up, unlike the normal logger
Link to this macro info(resource, fun, metadata \\ []) View Source (macro)

Mirrors calls to Logger.info/2, but spans the calls

The first argument: resource, is used to aggregate the data in trace tools, and sets the resource of the span. This also prepends the resource passed in to the message of your logs. This is made inexpensive by use of iolists, as opposed to actual string appending operations.

NOTICE

  • Only accepts functions as its second parameter.
  • Does NOT run the provided function if the log level does not line up, unlike the normal logger
Link to this macro warn(resource, fun, metadata \\ []) View Source (macro)

Mirrors calls to Logger.warn/2, but spans the calls

The first argument: resource, is used to aggregate the data in trace tools, and sets the resource of the span. This also prepends the resource passed in to the message of your logs. This is made inexpensive by use of iolists, as opposed to actual string appending operations.

NOTICE

  • Only accepts functions as its second parameter.
  • Does NOT run the provided function if the log level does not line up, unlike the normal logger