Packages

c

org.clapper.avsl.formatter

SimpleFormatter

class SimpleFormatter extends Formatter

SimpleFormatter represents the default formatter for the AVSL logger. It uses simple %-escaped format strings, akin to the standard C strftime() function. These escapes, described below, are more compact than the format strings used by Java's SimpleDateFormat class; they also don't suffer from the odd quoting conventions imposed by SimpleDateFormat. However, they are mapped to SimpleDateFormat patterns, so they are locale-, language-, and time zone-sensitive.

A SimpleFormatter accepts the following name/value pair arguments:

- format: The format to use. If not specified, there's a reasonable default - language: The language to use when formatting dates, using the Java Locale values. If not specified, the default locale is used. - country: The country to use when formatting dates, using the Java Locale values. If not specified, the default locale is used. - tz: The time zone to use. If not specified, the default is used.

The recognized format escapes are shown below. Anything else is displayed literally. Many of the escapes are borrowed directly from strftime().

- %a: the short day-of-week name (e.g., "Wed") - %A: the long day-of-week name (e.g., "Wednesday") - %b: the abbreviated month name (e.g., "Mar", "Nov") - %B: the full month name (e.g., "March", "November") - %d: the day of the month - %D: equivalent to %m/%d/%y - %F: equivalent to %Y/%m/%d - %h: the hour of the day (0-12) - %H: the hour of the day (1-23) - %j: the day of the year (i.e., the so-called Julian day) - %l: the log level name (e.g., "INFO", "DEBUG") - %L: the log level's numeric value - %m: the month number (01-12) - %M: the current minute, zero-padded - %n: the short name of the logger (i.e., the last part of the class name) - %N: the full name of the logger (i.e., the class name) - %s: the current second, zero-padded - %S: the current millisecond, zero-padded - %t: the text of the log message - %T: the current thread name - %y: the 2-digit year - %Y: the full 4-digit year - %z: the time zone name (e.g., "UTC", "PDT", "EST") - %%: a literal "%"

Linear Supertypes
Formatter, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SimpleFormatter
  2. Formatter
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new SimpleFormatter(args: ConfiguredArguments)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val DefaultFormat: String
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. val country: String
  8. val defaultLocale: Locale
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  12. def format(logMessage: LogMessage): String

    Format a log message, returning the formatted string.

    Format a log message, returning the formatted string.

    logMessage

    the log message to format

    returns

    the formatted message

    Definition Classes
    SimpleFormatterFormatter
  13. val formatString: String
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. val language: String
  18. lazy val locale: Locale
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  22. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  23. def toString(): String
    Definition Classes
    AnyRef → Any
  24. val tz: TimeZone
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from Formatter

Inherited from AnyRef

Inherited from Any

Ungrouped