Module: Celluloid::Internals::Logger

### Home Classes Methods

### In Files

- lib/celluloid/internals/logger.rb

### Namespace

- CLASS Celluloid::Internals::Logger::WithBacktrace

### Methods

- #crash
- #debug
- #deprecate
- #error
- #exception_handler
- #format_exception
- #info
- #warn
- #with_backtrace

### 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::Internals::Logger

### Public Instance Methods

crash(string, exception) click to toggle source

Handle a crash

    # File lib/celluloid/internals/logger.rb, line 59
    def crash(string, exception)
      if Celluloid.log_actor_crashes
        string << "\n" << format_exception(exception)
        error string
      end

      @exception_handlers.each do |handler|
        begin
          handler.call(exception)
        rescue => ex
          error "EXCEPTION HANDLER CRASHED:\n" << format_exception(ex)
        end
      end
    end

debug(string) click to toggle source

Send a debug message

    # File lib/celluloid/internals/logger.rb, line 39
    def debug(string)
      Celluloid.logger.debug(string) if Celluloid.logger && $CELLULOID_DEBUG
    end

deprecate(message) click to toggle source

Note a deprecation

    # File lib/celluloid/internals/logger.rb, line 75
    def deprecate(message)
      trace = caller.join("\n\t")
      warn "DEPRECATION WARNING: #{message}\n\t#{trace}"
    end

error(string) click to toggle source

Send an error message

    # File lib/celluloid/internals/logger.rb, line 54
    def error(string)
      Celluloid.logger.error(string) if Celluloid.logger
    end

exception_handler(&block) click to toggle source

Define an exception handler NOTE: These should be defined at application start time

    # File lib/celluloid/internals/logger.rb, line 82
    def exception_handler(&block)
      @exception_handlers << block
      nil
    end

format_exception(exception) click to toggle source

Format an exception message

    # File lib/celluloid/internals/logger.rb, line 88
    def format_exception(exception)
      str = "#{exception.class}: #{exception}\n\t"
      if exception.backtrace
        str << exception.backtrace.join("\n\t")
      else
        str << "EMPTY BACKTRACE\n\t"
      end
    end

info(string) click to toggle source

Send a info message

    # File lib/celluloid/internals/logger.rb, line 44
    def info(string)
      Celluloid.logger.info(string) if Celluloid.logger
    end

warn(string) click to toggle source

Send a warning message

    # File lib/celluloid/internals/logger.rb, line 49
    def warn(string)
      Celluloid.logger.warn(string) if Celluloid.logger
    end

with_backtrace(backtrace) click to toggle source

    # File lib/celluloid/internals/logger.rb, line 34
    def with_backtrace(backtrace)
      yield WithBacktrace.new(backtrace) if Celluloid.logger
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.