Module: Celluloid::Logger

### Home Classes Methods

### In Files

- lib/celluloid/logger.rb

### Namespace

- CLASS Celluloid::Logger::WithBacktrace

### Methods

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

### Class/Module Index

Quicksearch

- Celluloid
- Celluloid::AbortError
- Celluloid::AbstractProxy
- Celluloid::Actor
- Celluloid::Actor::Sleeper
- Celluloid::ActorProxy
- Celluloid::ActorSystem
- Celluloid::AsyncCall
- Celluloid::AsyncProxy
- Celluloid::BlockCall
- Celluloid::BlockProxy
- Celluloid::BlockResponse
- Celluloid::CPUCounter
- Celluloid::Call
- Celluloid::CallChain
- Celluloid::Cell
- Celluloid::Cell::ExitHandler
- Celluloid::CellProxy
- Celluloid::ClassMethods
- Celluloid::Condition
- Celluloid::Condition::Waiter
- Celluloid::ConditionError
- Celluloid::DeadTaskError
- Celluloid::ErrorResponse
- Celluloid::EventedMailbox
- Celluloid::ExitEvent
- Celluloid::FSM
- Celluloid::FSM::ClassMethods
- Celluloid::FSM::State
- Celluloid::FSM::UnattachedError
- Celluloid::FiberStackError
- Celluloid::Future
- Celluloid::Future::Result
- Celluloid::FutureProxy
- Celluloid::Handler
- Celluloid::Handlers
- Celluloid::Incident
- Celluloid::IncidentLogger
- Celluloid::IncidentLogger::Severity
- Celluloid::IncidentReporter
- Celluloid::IncidentReporter::Formatter
- Celluloid::InstanceMethods
- Celluloid::InternalPool
- Celluloid::LinkingRequest
- Celluloid::LinkingResponse
- Celluloid::Links
- Celluloid::LogEvent
- Celluloid::Logger
- Celluloid::Logger::WithBacktrace
- Celluloid::Mailbox
- Celluloid::MailboxDead
- Celluloid::MailboxShutdown
- Celluloid::Method
- Celluloid::NamingRequest
- Celluloid::NotTaskError
- Celluloid::Notifications
- Celluloid::Notifications::Fanout
- Celluloid::Notifications::Subscriber
- Celluloid::PoolManager
- Celluloid::Probe
- Celluloid::Properties
- Celluloid::Receiver
- Celluloid::Receivers
- Celluloid::Registry
- Celluloid::Response
- Celluloid::ResumableError
- Celluloid::RingBuffer
- Celluloid::SignalConditionRequest
- Celluloid::Signals
- Celluloid::StackDump
- Celluloid::StackDump::ActorState
- Celluloid::StackDump::CellState
- Celluloid::StackDump::DisplayBacktrace
- Celluloid::StackDump::TaskState
- Celluloid::StackDump::ThreadState
- Celluloid::SuccessResponse
- Celluloid::SupervisionGroup
- Celluloid::SupervisionGroup::Member
- Celluloid::Supervisor
- Celluloid::SyncCall
- Celluloid::SyncProxy
- Celluloid::SystemEvent
- Celluloid::Task
- Celluloid::Task::TerminatedError
- Celluloid::Task::TimeoutError
- Celluloid::TaskFiber
- Celluloid::TaskSet
- Celluloid::TaskThread
- Celluloid::TerminationRequest
- Celluloid::Thread
- Celluloid::ThreadHandle
- Celluloid::UUID
- org
- org::jruby
- org::jruby::ext
- org::jruby::ext::fiber
- org::jruby::ext::fiber::ThreadFiber
- Bar
- Baz
- Blocker
- ExampleActorClass
- ExampleCrash
- ExampleMailbox
- ExampleProxy
- ExampleTask
- Fiber
- Foo
- MockActor
- Object
- Thread

No matching classes.

# Celluloid::Logger

### Public Instance Methods

crash(string, exception) click to toggle source

Handle a crash

    # File lib/celluloid/logger.rb, line 57
    def crash(string, exception)
      string << "\n" << format_exception(exception)
      error string

      @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/logger.rb, line 37
    def debug(string)
      Celluloid.logger.debug(string) if Celluloid.logger
    end

deprecate(message) click to toggle source

Note a deprecation

    # File lib/celluloid/logger.rb, line 71
    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/logger.rb, line 52
    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/logger.rb, line 78
    def exception_handler(&block)
      @exception_handlers << block
      nil
    end

format_exception(exception) click to toggle source

Format an exception message

    # File lib/celluloid/logger.rb, line 84
    def format_exception(exception)
      str = "#{exception.class}: #{exception.to_s}\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/logger.rb, line 42
    def info(string)
      Celluloid.logger.info(string) if Celluloid.logger
    end

warn(string) click to toggle source

Send a warning message

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

with_backtrace(backtrace) click to toggle source

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.