Skip to content

Statsd example code fails with on_log exception #311

@ag-TJNII

Description

@ag-TJNII

Versions:

  • semantic_logger (4.16.1)
  • statsd-ruby (1.5.0)

While following https://logger.rocketjob.io/metrics.html the statsd example code fails:

require 'semantic_logger'

subscriber = SemanticLogger::Metric::Statsd.new(url: "udp://localhost:8125")
SemanticLogger.on_log(subscriber)
/home/tom/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/semantic_logger-4.16.1/lib/semantic_logger/logger.rb:11:in `subscribe': When supplying an on_log subscriber, it must support the #call method (RuntimeError)
        from /home/tom/.rbenv/versions/3.3.4/lib/ruby/gems/3.3.0/gems/semantic_logger-4.16.1/lib/semantic_logger/semantic_logger.rb:240:in `on_log'
        from tmp/log_test.rb:4:in `<main>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions