Class: Celluloid::IncidentReporter

### Home Classes Methods

### In Files

- lib/celluloid/logging/incident_reporter.rb

### Parent

Object

### Namespace

- CLASS Celluloid::IncidentReporter::Formatter

### Methods

- ::new
- #report
- #silence
- #silenced?
- #unsilence

### Included Modules

- Celluloid
- Celluloid::Notifications

### Class/Module Index

Quicksearch

- Celluloid
- Celluloid::Incident
- Celluloid::IncidentLogger
- Celluloid::IncidentLogger::Severity
- Celluloid::IncidentReporter
- Celluloid::IncidentReporter::Formatter
- Celluloid::Internals
- Celluloid::Internals::CPUCounter
- Celluloid::Internals::CallChain
- Celluloid::Internals::Handler
- Celluloid::Internals::Handlers
- Celluloid::Internals::Links
- Celluloid::Internals::Logger
- Celluloid::Internals::Logger::WithBacktrace
- Celluloid::Internals::Method
- Celluloid::Internals::Properties
- Celluloid::Internals::Receiver
- Celluloid::Internals::Receivers
- Celluloid::Internals::Registry
- Celluloid::Internals::Response
- Celluloid::Internals::Response::Block
- Celluloid::Internals::Response::Error
- Celluloid::Internals::Response::Success
- Celluloid::Internals::Signals
- Celluloid::Internals::Stack
- Celluloid::Internals::Stack::ActorState
- Celluloid::Internals::Stack::CellState
- Celluloid::Internals::Stack::DisplayBacktrace
- Celluloid::Internals::Stack::Dump
- Celluloid::Internals::Stack::Summary
- Celluloid::Internals::Stack::TaskState
- Celluloid::Internals::Stack::ThreadState
- Celluloid::Internals::TaskSet
- Celluloid::Internals::ThreadHandle
- Celluloid::Internals::UUID
- Celluloid::LogEvent
- Celluloid::Notifications
- Celluloid::Notifications::Fanout
- Celluloid::Notifications::Subscriber
- Celluloid::Probe
- Celluloid::RingBuffer

No matching classes.

# Celluloid::IncidentReporter

Subscribes to log incident topics to report on them.

### Public Class Methods

new(*args) click to toggle source

    # File lib/celluloid/logging/incident_reporter.rb, line 15
    def initialize(*args)
      subscribe(/log\.incident/, :report)
      @logger = ::Logger.new(*args)
      @logger.formatter = Formatter.new
      @silenced = false
    end

### Public Instance Methods

report(_topic, incident) click to toggle source

    # File lib/celluloid/logging/incident_reporter.rb, line 22
    def report(_topic, incident)
      return if @silenced

      header = "INCIDENT"
      header << " AT #{incident.triggering_event.time}" if incident.triggering_event
      @logger << header
      @logger << "\n"
      @logger << "====================\n"
      incident.events.each do |event|
        @logger.add(event.severity, event, event.progname)
      end
      @logger << "====================\n"
    end

silence() click to toggle source

    # File lib/celluloid/logging/incident_reporter.rb, line 36
    def silence
      @silenced = true
    end

silenced?() click to toggle source

    # File lib/celluloid/logging/incident_reporter.rb, line 44
    def silenced?
      @silenced
    end

unsilence() click to toggle source

    # File lib/celluloid/logging/incident_reporter.rb, line 40
    def unsilence
      @silenced = false
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.