logo

const class

sys::LogRecord

sys::Obj
  sys::LogRecord
  1  //
  2  // Copyright (c) 2006, Brian Frank and Andy Frank
  3  // Licensed under the Academic Free License version 3.0
  4  //
  5  // History:
  6  //   22 Dec 07  Brian Frank  Revamp
  7  //
  8  
  9  **
 10  ** LogRecord all the information of a single logging event.
 11  ** See `docLang::Logging` for details.
 12  **
 13  const class LogRecord
 14  {
 15  
 16    **
 17    ** Constructor with all the fields
 18    **
 19    new make(DateTime time, LogLevel level, Str logName, Str message, Err err := null)
 20  
 21    **
 22    ** Timestamp of log event
 23    **
 24    const DateTime time
 25  
 26    **
 27    ** Severity level of event
 28    **
 29    const LogLevel level
 30  
 31    **
 32    ** Name of `Log` which generated the event
 33    **
 34    const Str logName
 35  
 36    **
 37    ** Severity level of event
 38    **
 39    const Str message
 40  
 41    **
 42    ** Exception if applicable
 43    **
 44    const Err err
 45  
 46    **
 47    ** Return standard log format.
 48    **
 49    override Str toStr()
 50  
 51    **
 52    ** Print to the specified output stream.
 53    **
 54    Str print(OutStream out := Sys.out)
 55  
 56  }