Subversion Info

Rev
432
Last Checked In
2008-02-20 19:26:10 (10 hours ago)
Checked in by
deveiant

Methods

Included Modules

Class Index

Quicksearch

Arrow::Logger::HtmlOutputter

Output logging messages in ANSI colors according to their level

Constants

SVNRev
SVN Revision
SVNId
SVN Id
DEFAULT_DESCRIPTION
Default decription used when creating instances
HTML_FORMAT
The default logging output format

Public Instance Methods

write( time, level, name, frame, msg ) {|html| ...} click to toggle source

Write the given level, name, frame, and msg to the target output mechanism. Subclasses can call this with a block which will be passed the formatted message. If no block is supplied by the child, this method will check to see if $DEBUG is set, and if it is, write the log message to $deferr.

    # File lib/arrow/logger/htmloutputter.rb, line 61
61:     def write( time, level, name, frame, msg )
62:         escaped_msg = escape_html( msg )
63:         html = @format.interpolate( binding )
64: 
65:         if block_given?
66:             yield( html )
67:         else
68:             $deferr.puts( html ) if $DEBUG
69:         end
70:     end

Protected Instance Methods

initialize( uri, description=DEFAULT_DESCRIPTION, format='' ) click to toggle source

Override the default to add color scheme instance variable

    # File lib/arrow/logger/htmloutputter.rb, line 51
51:     def initialize( uri, description=DEFAULT_DESCRIPTION, format='' ) # :notnew:
52:         super
53:     end

secsequence

--- SEC00069

seccomment

--- ""

method_list

--- 
- methods: 
  - visibility: public
    aref: M000186
    name: write
    sourcecode: "    <span class=\"ruby-comment cmt\"># File lib/arrow/logger/htmloutputter.rb, line 61</span>\n\
      61:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">write</span>( <span class=\"ruby-identifier\">time</span>, <span class=\"ruby-identifier\">level</span>, <span class=\"ruby-identifier\">name</span>, <span class=\"ruby-identifier\">frame</span>, <span class=\"ruby-identifier\">msg</span> )\n\
      62:         <span class=\"ruby-identifier\">escaped_msg</span> = <span class=\"ruby-identifier\">escape_html</span>( <span class=\"ruby-identifier\">msg</span> )\n\
      63:         <span class=\"ruby-identifier\">html</span> = <span class=\"ruby-ivar\">@format</span>.<span class=\"ruby-identifier\">interpolate</span>( <span class=\"ruby-identifier\">binding</span> )\n\
      64: \n\
      65:         <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">block_given?</span>\n\
      66:             <span class=\"ruby-keyword kw\">yield</span>( <span class=\"ruby-identifier\">html</span> )\n\
      67:         <span class=\"ruby-keyword kw\">else</span>\n\
      68:             <span class=\"ruby-identifier\">$deferr</span>.<span class=\"ruby-identifier\">puts</span>( <span class=\"ruby-identifier\">html</span> ) <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">$DEBUG</span>\n\
      69:         <span class=\"ruby-keyword kw\">end</span>\n\
      70:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Write the given <tt>level</tt>, <tt>name</tt>, <tt>frame</tt>, and
      <tt>msg</tt> to the target output mechanism. Subclasses can call this with
      a block which will be passed the formatted message. If no block is supplied
      by the child, this method will check to see if $DEBUG is set, and if it is,
      <a href="HtmlOutputter.html#M000186">write</a> the log message to $deferr.
      </p>
    params: ( time, level, name, frame, msg ) {|html| ...}
  category: Instance
  type: Public
- methods: 
  - visibility: protected
    aref: M000185
    name: initialize
    sourcecode: "    <span class=\"ruby-comment cmt\"># File lib/arrow/logger/htmloutputter.rb, line 51</span>\n\
      51:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">initialize</span>( <span class=\"ruby-identifier\">uri</span>, <span class=\"ruby-identifier\">description</span>=<span class=\"ruby-constant\">DEFAULT_DESCRIPTION</span>, <span class=\"ruby-identifier\">format</span>=<span class=\"ruby-value str\">''</span> ) <span class=\"ruby-comment cmt\"># :notnew:</span>\n\
      52:         <span class=\"ruby-keyword kw\">super</span>\n\
      53:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Override the default to add color scheme instance variable
      </p>
    params: ( uri, description=DEFAULT_DESCRIPTION, format='' )
  category: Instance
  type: Protected

sectitle

--- 

constants

--- 
- name: SVNRev
  desc: |+
    
    SVN Revision
    
  value: "%q$Rev: 432 $"
- name: SVNId
  desc: |+
    
    SVN Id
    
  value: "%q$Id: htmloutputter.rb 432 2008-02-20 19:26:10Z deveiant $"
- name: DEFAULT_DESCRIPTION
  desc: |+
    
    Default decription used when creating instances
    
  value: "&quot;HTML Fragment Logging Outputter&quot;"
- name: HTML_FORMAT
  desc: |+
    
    The default logging output format
    
  value: "%q{     &lt;div class=&quot;log-message #{level}&quot;&gt;         &lt;span class=&quot;log-time&quot;&gt;#{time.strftime('%Y/%m/%d %H:%M:%S')}&lt;/span&gt;         &lt;span class=&quot;log-level&quot;&gt;#{level}&lt;/span&gt;         :         &lt;span class=&quot;log-name&quot;&gt;#{name}&lt;/span&gt;         &lt;span class=&quot;log-frame&quot;&gt;#{frame ? '('+frame+'): ' : ''}&lt;/span&gt;         &lt;span class=&quot;log-message-text&quot;&gt;#{escaped_msg}&lt;/span&gt;     &lt;/div&gt;     }"

[Validate]

Generated with the Darkfish Rdoc Generator.