Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 3399564cb1
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (20 sloc) 0.5 kb
#!/usr/bin/env ruby
# sevkme@gmail.com
require 'logger'
Dir.mkdir 'log' if not Dir.exist? 'log'
#记录到日志文件,参数是要记录的内容,不给参数则记录当前错误描述,未出错就是空。
def log(s=nil)
if not s
if $!
s = "#{$!.message} #{$@.join("\n")}"
else
return
end
end
puts s.to_s
#daily/weekly/monthly.
logger = Logger.new("./log/log_#{ENV['USER']}.log",shift_age=30,10240000)
logger.level = Logger::DEBUG
logger.debug{s}
end
log('start.')
Jump to Line
Something went wrong with that request. Please try again.