Sha256: af92e73394a0d6b57737cfceeaf80f97df6d35cffa1e66b75b8b63f3154b10f6

Contents?: true

Size: 1.33 KB

Versions: 3

Compression:

Stored size: 1.33 KB

Contents

#          Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.

require 'swiftcore/Analogger/Client'

module Ramaze
  module Logger
    
    ##
    # Informer for the Swiftcore Analogger logging system.
    #
    # You can find it at http://analogger.swiftcore.org and install with
    # gem install analogger
    #
    class Analogger < ::Swiftcore::Analogger::Client
      include Logging

      # identifier for your application
      trait :name => 'walrus'

      # Host analogger runs on
      trait :host => '127.0.0.1'

      # Port analogger runs on
      trait :port => 6766

      ##
      # Create a new instance, parameters default to the traits.
      #
      # @param [String] name The name of the logging system (can be anything you like).
      # @param [String] host The IP/hostname on which the logging system is running.
      # @param [Integer] port The port of the logging system.
      #
      def initialize(name = class_trait[:name], host = class_trait[:host], 
      port = class_trait[:port])
        super
      end

      ##
      # Integration to Logging
      #
      # @param [String] tag
      # @param [Hash] args
      #
      def log(tag, *args)
        super(tag, args.join("\n"))
      end
    end # Analogger
  end # Log
end # Ramaze

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ramaze-2011.12.28 lib/ramaze/log/analogger.rb
ramaze-2011.10.23 lib/ramaze/log/analogger.rb
ramaze-2011.07.25 lib/ramaze/log/analogger.rb