Module: Envoy
- Defined in:
- lib/envoy/utils.rb,
lib/envoy/version.rb,
lib/envoy/protocol.rb,
lib/envoy/server/web.rb,
lib/envoy/client/trunk.rb,
lib/envoy/server/trunk.rb,
lib/envoy/client/channel.rb,
lib/envoy/server/channel.rb
Defined Under Namespace
Modules: Client, Protocol, Server
Constant Summary collapse
- TRACE =
5- DEBUG =
4- INFO =
3- WARN =
2- ERROR =
1- FATAL =
0- VERBOSITIES =
"FEWIDT"- VERSION =
'1.0.0'
Class Attribute Summary collapse
-
.verbosity ⇒ Object
Returns the value of attribute verbosity.
Class Method Summary collapse
Class Attribute Details
.verbosity ⇒ Object
Returns the value of attribute verbosity.
13 14 15 |
# File 'lib/envoy/utils.rb', line 13 def verbosity @verbosity end |
Class Method Details
.find_file(name) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/envoy/utils.rb', line 28 def self.find_file (name) dirs = Dir.pwd.split("/") r = dirs.reduce([]) do |m, x| [[*m[0], x], *m] end.map do |p| p.join("/") + "/#{name}" end.each do |p| return p if File.exist?(p) end false end |
.log(level, text, io = STDERR) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/envoy/utils.rb', line 16 def self.log (level, text, io = STDERR) return unless io return unless level <= verbosity = [ Time.now.strftime("%F %T"), VERBOSITIES[level][0], text ].compact.join(" ") io.puts io.flush end |