Skip to content

Commit

Permalink
Use "module_function def foo(args)" instead separating them
Browse files Browse the repository at this point in the history
with an empty line like Rubocop wants.
  • Loading branch information
mvidner committed Aug 4, 2015
1 parent 4ebc052 commit 0815357
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions src/ruby/yast/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
require "yast/builtins"

module Yast
module_function

# @private
def y2_logger_helper(level, args)
module_function def y2_logger_helper(level, args)
caller_frame = 1
backtrace = false

Expand All @@ -31,46 +29,34 @@ def y2_logger_helper(level, args)
end
end

module_function

# write to log debug message with arguments formated by {Yast::Builtins.sformat}
def y2debug(*args)
module_function def y2debug(*args)
y2_logger_helper(0, args)
end

module_function

# write to log milestone message with arguments formated by {Yast::Builtins.sformat}
def y2milestone(*args)
module_function def y2milestone(*args)
y2_logger_helper(1, args)
end

module_function

# write to log warning message with arguments formated by {Yast::Builtins.sformat}
def y2warning(*args)
module_function def y2warning(*args)
y2_logger_helper(2, args)
end

module_function

# write to log error message with arguments formated by {Yast::Builtins.sformat}
def y2error(*args)
module_function def y2error(*args)
y2_logger_helper(3, args)
end

module_function

# write to log security message with arguments formated by {Yast::Builtins.sformat}
# @todo make it clear what is supposed to write to this level
def y2security(*args)
module_function def y2security(*args)
y2_logger_helper(4, args)
end

module_function

# write to log internal error message with arguments formated by {Yast::Builtins.sformat}
def y2internal(*args)
module_function def y2internal(*args)
y2_logger_helper(5, args)
end
end # module YaST

0 comments on commit 0815357

Please sign in to comment.