lib/nrser/log/logger.rb
# Let 'em know they done wrong.
# 
# Which is funny, because only I use the library, and probably only I will
# ever use this library. So I'm basically nagging my-fucking-self. Sad.
# 
# @param [Array] message
#   Message segments, formatted with {NRSER.fmt_msg}.
# 
# @param [String] method
#   Something about what method it is.
# 
# @param [String?] alternative
#   Optionally (hopefully) something about what I should be using.
# 
# @param [Integer] max_stack_lines
#   How many lines of the stack to spew out (it can get real big real easy).
# 
# @return [nil]
# 
Let 'em know they done wrong.
Which is funny, because only I use the library, and probably only I will
ever use this library. So I'm basically nagging my-fucking-self. Sad.
Let ' em know they done wrong . Which is funny because only I use the library and probably only I will ever use this library . So I ' m basically nagging my - fucking - self . Sad .
def deprecated *message, method:, alternative: nil, max_stack_lines: 16
    kwds = { method: method }
    kwds[:alternative] = alternative if alternative
    if max_stack_lines > 0
      kwds[:stack] =  NRSER::ellipsis \
                        caller,
                        max_stack_lines,
                        omission: '[ ...omitted... ]'
    end
    if message.empty?
      message = [ "Method", method, "has been DEPRECIATED" ]
    else
      message = [ 'DEPRECIATED:', *message ]
    end
    warn NRSER.fmt_msg( *message ), **kwds
    nil
  end
def deprecated * message , method : , alternative : nil , max_stack_lines : 16 kwds = { method : method } kwds [ :alternative ] = alternative if alternative if max_stack_lines > 0 kwds [ :stack ] = NRSER :: ellipsis caller , max_stack_lines , omission : '[ ...omitted... ]' end if message . empty? message = [ "Method" , method , "has been DEPRECIATED" ] else message = [ 'DEPRECIATED:' , * message ] end warn NRSER . fmt_msg ( * message ) , ** kwds nil end
Let 'em know they done wrong.
Let ' em know they done wrong .
None
nil
message
<not_specific>
method
<not_specific>
alternative
<not_specific>
max_stack_lines
<not_specific>
<not_specific>
max_stack_lines How many lines of the stack to spew out (it can get real big real easy).
max_stack_lines How many lines of the stack to spew out ( it can get real big real easy ) .