summaryrefslogtreecommitdiff
path: root/lib/ot-logger.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2011-03-09 12:31:05 +0100
committerChristoph Helma <helma@in-silico.ch>2011-03-09 12:31:05 +0100
commitc651fe10fe5e09dbfdf2b3abd420fc2fc0051937 (patch)
tree30029f9c3246de739aaf7b66a490c01b7b147f04 /lib/ot-logger.rb
parent5233ab341757557c536ed8cc8eefd79a936b4295 (diff)
parent66f2ee967317954568562510111b0d832881547d (diff)
Merge branch 'release/v1.0.0'v1.0.0
Conflicts: lib/dataset.rb
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
-