Skip to content

Utility for creating an no-op Tracer #206

@chris-martin

Description

@chris-martin

I just had the annoyance of adapting an application that doesn't use tracing to a library that does; I need a no-op Tracer to satisfy a MonadTracer constraint.

It would be neat if MonadTracer were actually something like getTracer :: m (Maybe Tracer) rather than m Tracer.

Alternatively it would be nice to just have a utility for easily creating a do-nothing Tracer.

noTracer = do
  tracerProvider <- createTracerProvider [] emptyTracerProviderOptions
  pure $ makeTracer tracerProvider "" tracerOptions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions