Class: HQ::Logger::RawLogger

Inherits:
IoLogger show all
Defined in:
lib/hq/logger/raw-logger.rb

Instance Attribute Summary

Attributes inherited from IoLogger

#level, #out

Instance Method Summary collapse

Methods inherited from IoLogger

#fix_stuff, #output

Instance Method Details

#output_real(content, stuff) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/hq/logger/raw-logger.rb', line 14

def output_real content, stuff

	data = {
		mode: stuff[:mode],
		content: [ content ],
	}

	data_json = begin
		MultiJson.dump data
	rescue
		out.puts "ERROR encoding #{content} (#{content.encoding})"
	end

	out.print MultiJson.dump(data) + "\n"

end

#valid_modesObject



10
11
12
# File 'lib/hq/logger/raw-logger.rb', line 10

def valid_modes
	[ :normal, :partial, :complete ]
end