Class Heel::Logger
In: lib/heel/logger.rb
lib/heel/logger.rb
Parent: ::Rack::CommonLogger

wrapper around the rack common logger to open up the file and flush the logs this is invoked with a ‘use’ command in the Builder so a new instance of ‘Logger’ in created with each request, so we do all the heavy lifting in the meta class.

Methods

<<   <<   log   log   log_file=   log_file=   new   new  

Public Class methods

[Source]

    # File lib/heel/logger.rb, line 18
18:       def log
19:         # the log can get closed if daemonized, the at_exit will close it.
20:         if @log.closed? then
21:           @log = File.open(@log_file, "a")
22:         end
23:         @log
24:       end

[Source]

    # File lib/heel/logger.rb, line 18
18:       def log
19:         # the log can get closed if daemonized, the at_exit will close it.
20:         if @log.closed? then
21:           @log = File.open(@log_file, "a")
22:         end
23:         @log
24:       end

[Source]

    # File lib/heel/logger.rb, line 26
26:       def log_file=(lf)
27:         @log_file = lf
28:         @log = File.open(@log_file, "a")
29:         at_exit { @log.close unless @log.closed? }
30:       end

[Source]

    # File lib/heel/logger.rb, line 26
26:       def log_file=(lf)
27:         @log_file = lf
28:         @log = File.open(@log_file, "a")
29:         at_exit { @log.close unless @log.closed? }
30:       end

[Source]

    # File lib/heel/logger.rb, line 33
33:     def initialize(app)
34:       super(app)
35:     end

[Source]

    # File lib/heel/logger.rb, line 33
33:     def initialize(app)
34:       super(app)
35:     end

Public Instance methods

[Source]

    # File lib/heel/logger.rb, line 37
37:     def <<(str)
38:       Heel::Logger.log.write( str )
39:       Heel::Logger.log.flush
40:     end

[Source]

    # File lib/heel/logger.rb, line 37
37:     def <<(str)
38:       Heel::Logger.log.write( str )
39:       Heel::Logger.log.flush
40:     end

[Validate]