org.scalawag.timber

api

package api

Visibility
  1. Public
  2. All

Type Members

  1. case class Level(level: Int, name: Option[String] = None) extends Product with Serializable

  2. class Logger extends AnyRef

    The main application interface into timber.

    The main application interface into timber.

    Loggers are what applications use to inject @link Entries into the system.

    Loggers don't support the isEnabled type methods provided by some other logging systems. That's because the Logger doesn't make any decisions regarding where (or if) the entry it creates is actually written into a log file or processed in any way.

    The idea behind timber is that the application thread gets to return to what it's doing as quickly as possible.

    Arguably, this is better for the application code because your application code shouldn't be dependent on the logging configuration. You have to try really hard to write code that depends on logging configuration.

  3. trait LoggerFactory[+T <: Logger] extends AnyRef

    This class gives you a way to create Logger classes.

    This class gives you a way to create Logger classes. Using the old patterns established by log4j, you can either give each Logger a name or use the convention of naming your Loggers based on the class doing the logging. If you only want to do the latter, you can simply follow the pattern of extending the Logging trait for your application and it will create a Logger per instance for you. If that's not what you want, for example, if you want a special Logger with a simple name like "ERRORS," you can create that Logger explicitly from the LoggerManager. It's fine to mix the styles.

  4. trait Logging[+T <: Logger] extends AnyRef

    This is a convenient way to expose a log member to classes that need to log and pull in the implicits that are needed for normal logging patterns.

    This is a convenient way to expose a log member to classes that need to log and pull in the implicits that are needed for normal logging patterns. Note that implementing this trait directly necessitates implementing the "loggerFactory" member. In a typical application, you would extend this trait with an application-specific subclass that defines the LoggerFactory in use by your application.

    Note that this creates a per-instance Logger field, even though all the fields should point to the same Logger. If you have a ton of instances for a particular class and want to keep the memory footprint as small as possible, you may want to explicitly refer to a field in a companion object (which can implement this trait). In that case, you'll probably have to import the Logging implicits explicitly.

  5. class Message extends AnyRef

    Message represents the textual content of the log entry.

    Message represents the textual content of the log entry. Each String represents a line in the message. While the EventFormatter will ultimately decide how the message is rendered, it is customary to separate the "lines" of the Message with line breaks (hence the name). You don't normally need to create instances of this class directly but can use the implicits defined in the Logging object.

  6. trait Tag extends AnyRef

    This trait has no significance other than marking classes that can be used as tags in timber.

    This trait has no significance other than marking classes that can be used as tags in timber. While you could technically use anything as a tag, this makes it so that the Logger API is a little nicer since this type is particular to timber.

Value Members

  1. object Level extends Serializable

  2. object LoggingContext

  3. object Message

    Message contains some "static" functions that are useful to consumers of the API.

    Message contains some "static" functions that are useful to consumers of the API. Normally, they'll be mixed into consumer classes through extending the Logging trait below. These are available in case you need to get to the implicit conversions outside of Logging (trait) subclass.

  4. package impl

  5. package style

Ungrouped