lib/wovnrb/services/wovn_logger.rb in wovnrb-1.1.0 vs lib/wovnrb/services/wovn_logger.rb in wovnrb-2.0.0
- old
+ new
@@ -3,10 +3,16 @@
module Wovnrb
class WovnLogger
include Singleton
+ class << self
+ def error(message)
+ instance.error(message)
+ end
+ end
+
def initialize
path = Store.instance.settings['log_path']
if path
begin
@logger = Logger.new(path)
@@ -24,13 +30,11 @@
end
end
def set_logger(logger)
[:error].each do |method|
- unless logger.respond_to? method
- raise 'not suite for logger'
- end
+ raise 'not suite for logger' unless logger.respond_to? method
end
@logger = logger
end
@@ -40,6 +44,6 @@
else
@logger.error message
end
end
end
-end
\ No newline at end of file
+end