Top Level Namespace

Defined Under Namespace

Modules: LogInFile, Logif

Instance Method Summary collapse

Instance Method Details

#logif(*args) ⇒ Object

main =

Parameters:

  • sevevity (Integer)
    Optional
  • message (String)

    The message to log in the file

  • options (Hash|Nil)

    Options :data Data for template message (message with %…)



14
15
16
17
18
19
20
21
22
23
# File 'lib/log_in_file/main.rb', line 14

def logif(*args)
  if args[0].is_a?(Integer)
    severity, message, options = args
    return unless Logif.severity?(severity)
  else
    message, options = args
  end
  options ||= {}    
  LogInFile.write(message, **options) # return true if ok
end