Add option to specify logfile
This commit is contained in:
parent
eec4e58dd9
commit
015feedad3
@ -35,10 +35,11 @@ module SMSd
|
||||
|
||||
def init_logger
|
||||
@logger = Logger.new(
|
||||
Util::MultiIO.new(STDOUT, File.open('debug.log', 'a')))
|
||||
Util::MultiIO.new(STDOUT,
|
||||
File.open(@options[:logfile] || 'smsd.log', 'a')))
|
||||
|
||||
logger.formatter = proc do |severity, datetime, progrname, msg|
|
||||
"#{datetime} [#{severity}] #{msg}\n"
|
||||
"#{$PROGRAM_NAME}: #{datetime} [#{severity}] #{msg}\n"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -17,6 +17,10 @@ module SMSd
|
||||
options[:daemonize] = daemon
|
||||
end
|
||||
|
||||
opts.on('-l', '--log-file', 'Define log file') do |logfile|
|
||||
options[:logfile] = logfile
|
||||
end
|
||||
|
||||
opts.on('-p', '--pin PIN', 'Specify the SIM PIN') do |pin|
|
||||
options[:pin] = pin
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user