summaryrefslogtreecommitdiff
path: root/lib/ot-logger.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ot-logger.rb')
-rw-r--r--lib/ot-logger.rb48
1 files changed, 0 insertions, 48 deletions
diff --git a/lib/ot-logger.rb b/lib/ot-logger.rb
deleted file mode 100644
index df38d77..0000000
--- a/lib/ot-logger.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-require 'logger'
-# logging
-class MyLogger < Logger
-
- def pwd
- path = Dir.pwd.to_s
- index = path.rindex(/\//)
- return path if index==nil
- path[(index+1)..-1]
- end
-
- def trace()
- lines = caller(0)
- n = 2
- line = lines[n]
-
- while (line =~ /spork.rb/ or line =~ /as_task/ or line =~ /ot-logger.rb/)
- n += 1
- line = lines[n]
- end
-
- index = line.rindex(/\/.*\.rb/)
- return line if index==nil
- line[index..-1]
- end
-
- def format(msg)
- pwd.ljust(18)+" :: "+msg.to_s+" :: "+trace+" :: "+($sinatra ? $sinatra.request.env['REMOTE_ADDR'] : nil).to_s
- end
-
- def debug(msg)
- super format(msg)
- end
-
- def info(msg)
- super format(msg)
- end
-
- def warn(msg)
- super format(msg)
- end
-
- def error(msg)
- super format(msg)
- end
-
-end
-