Flog

com.phasmidsoftware.flog.Flog
See theFlog companion object
case class Flog(logger: Logger) extends AutoCloseable, Loggables

Simple functional logging class.

Here are the steps you need to follow to enable logging:

  • To instantiate a new instance of Flog, specifying the class for which you are logging: simply invoke the apply method: Flog[MyClass]. Assuming that you named the variable "flog", then "import flog._"

  • Create a String which will form the log message, follow it with "!!" (info), or "!?" (debug), or other method, and follow that with the expression you want to log. The construct in this form (including the message and "!!") will yield the value of the expression.

  • Most of the time, this is all you need to do (see README.md for much more information on this).

There are several ways to turn logging off (temporarily or permanently) once you've added the log expressions:

(0)
configure the logger (using logback.xml or similar) to ignore the particular log level;
(1)
replace the !! method with the |! method for each expression you wish to silence;
(2)
use a disabled Flog with flog.disabled (silences all flogging everywhere);
(3)
remove the !! expressions.

Value parameters

logger

the Logger which is to be used by this Flog.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Loggables
trait AutoCloseable
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def close(): Unit

Close this Flog. For standard slf4j loggers, this does nothing. However, for Appendable loggers, this call will typically flush and close the appendable instance.

Close this Flog. For standard slf4j loggers, this does nothing. However, for Appendable loggers, this call will typically flush and close the appendable instance.

Attributes

def disabled: Flog

Use this method to create a new Flog with logging disabled.

Use this method to create a new Flog with logging disabled.

Attributes

Returns

a new instance of Flog.

override def toString: String

Method to capture any text held by this Flog. In the case of a "standard" slf4j logger, the returned value will is undefined.

Method to capture any text held by this Flog. In the case of a "standard" slf4j logger, the returned value will is undefined.

Attributes

Returns

the value of logger.toString.

Definition Classes
Any
def withLogger(logger: Logger): Flog

Use this method to create a new Flog based on the given logging function.

Use this method to create a new Flog based on the given logging function.

Value parameters

logger

an instance of LogFunction.

Attributes

Returns

a new instance of Flog.

Inherited methods

def anyLoggable[T]: Loggable[T]

Backstop method to yield a String from a T. NOTE: use this when you need a Loggable to log a container which includes an unsupported type.

Backstop method to yield a String from a T. NOTE: use this when you need a Loggable to log a container which includes an unsupported type.

Type parameters

T

the type of t.

Attributes

Returns

a Loggable[T] which uses toString.

Inherited from:
Loggables
def eitherLoggable[L : Loggable, R : Loggable]: Loggable[Either[L, R]]

Method to return a Loggable[ Either[L, R] ].

Method to return a Loggable[ Either[L, R] ].

Type parameters

L

the "left" type of any Either which is to be logged.

R

the "right" type of any Either which is to be logged.

Attributes

Returns

a Loggable[ Either[L, R] ].

Inherited from:
Loggables
def iterableLoggable[T : Loggable](bookends: String, atLeast: Int): Loggable[Iterable[T]]

Method to create a Loggable of an Iterable[T]. The elements of the result are then logged utilizing the !! method.

Method to create a Loggable of an Iterable[T]. The elements of the result are then logged utilizing the !! method.

Type parameters

T

the underlying type of the elements to be logged. Must provide evidence of Loggable[T].

Value parameters

atLeast

the minimum number of elements to show in the log message before the ellipsis section starts.

bookends

(optional) a String of length two specifying the first and last characters of the resulting String for a given Iterable. Defaults to "[]".

Attributes

Returns

Loggable[ Iterable[T] ].

Inherited from:
Loggables
def kVLoggable[K : Loggable, V : Loggable]: Loggable[(K, V)]

This method creates a Loggable instance which works for a tuple (a K-V pair). It is an alternative to loggable2 but that method names the members whereas we don't want them named here.

This method creates a Loggable instance which works for a tuple (a K-V pair). It is an alternative to loggable2 but that method names the members whereas we don't want them named here.

Type parameters

K

the key type.

V

the value type.

Attributes

Returns

a Loggable[(K, V)].

Inherited from:
Loggables
def loggable1[P0 : Loggable, T <: Product : ClassTag](construct: P0 => T, fields: Seq[String]): Loggable[T]

Method to return a Loggable[T] where T is a 1-ary Product and which is based on a function to convert a P0 into a T.

Method to return a Loggable[T] where T is a 1-ary Product and which is based on a function to convert a P0 into a T.

NOTE: be careful using this particular method it only applies where T is a 1-tuple (e.g. a case class with one field -- not common). It probably shouldn't ever be used in practice. It can cause strange initialization errors!

Type parameters

P0

the type of the (single) field of the Product type T.

T

the underlying type of the first parameter of the input to the render method.

Value parameters

construct

a function P0 => T, usually the apply method of a case class. The sole purpose of this function is for type inference--it is never actually invoked.

fields

(optional parameter) an explicit list of one field name.

Attributes

Returns

a Loggable[T].

Inherited from:
Loggables
def loggable2[P0 : Loggable, P1 : Loggable, T <: Product : ClassTag](construct: (P0, P1) => T, fields: Seq[String]): Loggable[T]

Method to return a Loggable[T] where T is a 2-ary Product and which is based on a function to convert a (P0, P1) into a T.

Method to return a Loggable[T] where T is a 2-ary Product and which is based on a function to convert a (P0, P1) into a T.

Type parameters

P0

the type of the first field of the Product type T.

P1

the type of the second field of the Product type T.

T

the underlying type of the first parameter of the input to the render method.

Value parameters

construct

a function (P0, P1) => T, usually the apply method of a case class. The sole purpose of this function is for type inference--it is never actually invoked.

fields

(optional parameter) an explicit list of 2 field names.

Attributes

Returns

a Loggable[T].

Inherited from:
Loggables
def loggable3[P0 : Loggable, P1 : Loggable, P2 : Loggable, T <: Product : ClassTag](construct: (P0, P1, P2) => T, fields: Seq[String]): Loggable[T]

Method to return a Loggable[T] where T is a 3-ary Product and which is based on a function to convert a (P0, P1, P2) into a T.

Method to return a Loggable[T] where T is a 3-ary Product and which is based on a function to convert a (P0, P1, P2) into a T.

Type parameters

P0

the type of the first field of the Product type T.

P1

the type of the second field of the Product type T.

P2

the type of the third field of the Product type T.

T

the underlying type of the first parameter of the input to the render method.

Value parameters

construct

a function (P0, P1, P2) => T, usually the apply method of a case class. The sole purpose of this function is for type inference--it is never actually invoked.

fields

(optional parameter) an explicit list of 3 field names.

Attributes

Returns

a Loggable[T].

Inherited from:
Loggables
def loggable4[P0 : Loggable, P1 : Loggable, P2 : Loggable, P3 : Loggable, T <: Product : ClassTag](construct: (P0, P1, P2, P3) => T, fields: Seq[String]): Loggable[T]

Method to return a Loggable[T] where T is a 4-ary Product and which is based on a function to convert a (P0, P1, P2, P3) into a T.

Method to return a Loggable[T] where T is a 4-ary Product and which is based on a function to convert a (P0, P1, P2, P3) into a T.

Type parameters

P0

the type of the first field of the Product type T.

P1

the type of the second field of the Product type T.

P2

the type of the third field of the Product type T.

P3

the type of the fourth field of the Product type T.

T

the underlying type of the first parameter of the input to the render method.

Value parameters

construct

a function (P0, P1, P2, P3) => T, usually the apply method of a case class. The sole purpose of this function is for type inference--it is never actually invoked.

fields

(optional parameter) an explicit list of 4 field names.

Attributes

Returns

a Loggable[T].

Inherited from:
Loggables
def loggable5[P0 : Loggable, P1 : Loggable, P2 : Loggable, P3 : Loggable, P4 : Loggable, T <: Product : ClassTag](construct: (P0, P1, P2, P3, P4) => T, fields: Seq[String]): Loggable[T]

Method to return a Loggable[T] where T is a 5-ary Product and which is based on a function to convert a (P0, P1, P2, P3, P4) into a T.

Method to return a Loggable[T] where T is a 5-ary Product and which is based on a function to convert a (P0, P1, P2, P3, P4) into a T.

Type parameters

P0

the type of the first field of the Product type T.

P1

the type of the second field of the Product type T.

P2

the type of the third field of the Product type T.

P3

the type of the fourth field of the Product type T.

P4

the type of the fifth field of the Product type T.

T

the underlying type of the first parameter of the input to the render method.

Value parameters

construct

a function (P0, P1, P2, P3, P4) => T, usually the apply method of a case class. The sole purpose of this function is for type inference--it is never actually invoked.

fields

(optional parameter) an explicit list of 5 field names.

Attributes

Returns

a Loggable[T].

Inherited from:
Loggables
def loggable6[P0 : Loggable, P1 : Loggable, P2 : Loggable, P3 : Loggable, P4 : Loggable, P5 : Loggable, T <: Product : ClassTag](construct: (P0, P1, P2, P3, P4, P5) => T, fields: Seq[String]): Loggable[T]

Method to return a Loggable[T] where T is a 6-ary Product and which is based on a function to convert a (P0, P1, P2, P3, P4, P5) into a T.

Method to return a Loggable[T] where T is a 6-ary Product and which is based on a function to convert a (P0, P1, P2, P3, P4, P5) into a T.

Type parameters

P0

the type of the first field of the Product type T.

P1

the type of the second field of the Product type T.

P2

the type of the third field of the Product type T.

P3

the type of the fourth field of the Product type T.

P4

the type of the fifth field of the Product type T.

P5

the type of the sixth field of the Product type T.

T

the underlying type of the first parameter of the input to the render method.

Value parameters

construct

a function (P0, P1, P2, P3, P4, P5) => T, usually the apply method of a case class. The sole purpose of this function is for type inference--it is never actually invoked.

fields

(optional parameter) an explicit list of 6 field names.

Attributes

Returns

a Loggable[T].

Inherited from:
Loggables
def loggable7[P0 : Loggable, P1 : Loggable, P2 : Loggable, P3 : Loggable, P4 : Loggable, P5 : Loggable, P6 : Loggable, T <: Product : ClassTag](construct: (P0, P1, P2, P3, P4, P5, P6) => T, fields: Seq[String]): Loggable[T]

Method to return a Loggable[T] where T is a 7-ary Product and which is based on a function to convert a (P0, P1, P2, P3, P4, P5, P6) into a T.

Method to return a Loggable[T] where T is a 7-ary Product and which is based on a function to convert a (P0, P1, P2, P3, P4, P5, P6) into a T.

Type parameters

P0

the type of the first field of the Product type T.

P1

the type of the second field of the Product type T.

P2

the type of the third field of the Product type T.

P3

the type of the fourth field of the Product type T.

P4

the type of the fifth field of the Product type T.

P5

the type of the sixth field of the Product type T.

P6

the type of the seventh field of the Product type T.

T

the underlying type of the first parameter of the input to the render method.

Value parameters

construct

a function (P0, P1, P2, P3, P4, P5, P6) => T, usually the apply method of a case class. The sole purpose of this function is for type inference--it is never actually invoked.

fields

(optional parameter) an explicit list of 7 field names.

Attributes

Returns

a Loggable[T].

Inherited from:
Loggables
def loggable8[P0 : Loggable, P1 : Loggable, P2 : Loggable, P3 : Loggable, P4 : Loggable, P5 : Loggable, P6 : Loggable, P7 : Loggable, T <: Product : ClassTag](construct: (P0, P1, P2, P3, P4, P5, P6, P7) => T, fields: Seq[String]): Loggable[T]

Method to return a Loggable[T] where T is a 8-ary Product and which is based on a function to convert a (P0, P1, P2, P3, P4, P5, P6, P7) into a T.

Method to return a Loggable[T] where T is a 8-ary Product and which is based on a function to convert a (P0, P1, P2, P3, P4, P5, P6, P7) into a T.

Type parameters

P0

the type of the first field of the Product type T.

P1

the type of the second field of the Product type T.

P2

the type of the third field of the Product type T.

P3

the type of the fourth field of the Product type T.

P4

the type of the fifth field of the Product type T.

P5

the type of the sixth field of the Product type T.

P6

the type of the seventh field of the Product type T.

P7

the type of the eighth field of the Product type T.

T

the underlying type of the first parameter of the input to the render method.

Value parameters

construct

a function (P0, P1, P2, P3, P4, P5, P6, P7) => T, usually the apply method of a case class. The sole purpose of this function is for type inference--it is never actually invoked.

fields

(optional parameter) an explicit list of 8 field names.

Attributes

Returns

a Loggable[T].

Inherited from:
Loggables
def loggable9[P0 : Loggable, P1 : Loggable, P2 : Loggable, P3 : Loggable, P4 : Loggable, P5 : Loggable, P6 : Loggable, P7 : Loggable, P8 : Loggable, T <: Product : ClassTag](construct: (P0, P1, P2, P3, P4, P5, P6, P7, P8) => T, fields: Seq[String]): Loggable[T]

Method to return a Loggable[T] where T is a 9-ary Product and which is based on a function to convert a (P0, P1, P2, P3, P4, P5, P6, P7, P8) into a T.

Method to return a Loggable[T] where T is a 9-ary Product and which is based on a function to convert a (P0, P1, P2, P3, P4, P5, P6, P7, P8) into a T.

Type parameters

P0

the type of the first field of the Product type T.

P1

the type of the second field of the Product type T.

P2

the type of the third field of the Product type T.

P3

the type of the fourth field of the Product type T.

P4

the type of the fifth field of the Product type T.

P5

the type of the sixth field of the Product type T.

P6

the type of the seventh field of the Product type T.

P7

the type of the eighth field of the Product type T.

P8

the type of the ninth field of the Product type T.

T

the underlying type of the first parameter of the input to the render method.

Value parameters

construct

a function (P0, P1, P2, P3, P4, P5, P6, P7, P8) => T, usually the apply method of a case class. The sole purpose of this function is for type inference--it is never actually invoked.

fields

(optional parameter) an explicit list of 9 field names.

Attributes

Returns

a Loggable[T].

Inherited from:
Loggables
def mapLoggable[K, T : Loggable](bookends: String): Loggable[Map[K, T]]

Method to return a Loggable[ Map[K, T] ].

Method to return a Loggable[ Map[K, T] ].

NOTE: unless the Map (passed as the bound variable) is a SeqMap, the order of the key-value pairs is undefined.

Type parameters

K

the type of the keys.

T

the underlying type of the values.

Value parameters

bookends

(optional) a String of length two specifying the first and last characters of the resulting String for a given Map. Defaults to "{}".

Attributes

Returns

a Loggable[ Map[K, T] ]

Inherited from:
Loggables
def optionLoggable[T : Loggable]: Loggable[Option[T]]

Method to return a Loggable[ Option[T] ].

Method to return a Loggable[ Option[T] ].

Type parameters

T

the underlying type of the first parameter of the input to the render method.

Attributes

Returns

a Loggable[ Option[T] ].

Inherited from:
Loggables
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def triedIterableLoggable[X, Y : Loggable](f: X => Try[Y]): Loggable[Iterable[X]]

TESTME

TESTME

Method which maps an Iterable of X with a function to an Iterable of Try[Y]. The elements of the result are then logged utilizing the !! method. NOTE that the returned value will only include the successful elements.

Type parameters

X

the underlying type of xs.

Y

the underlying type of the intermediate type (must be Loggable).

Value parameters

f

a function X => Try[Y].

Attributes

Returns

an Iterable of Try[Y] such that all the failures have been logged but not included in the result.

Inherited from:
Loggables
def tryLoggable[T : Loggable]: Loggable[Try[T]]

Method to return a Loggable[ Try[T] ].

Method to return a Loggable[ Try[T] ].

Type parameters

T

the underlying type of the first parameter of the input to the render method.

Attributes

Returns

a Loggable[ Try[T] ].

Inherited from:
Loggables

Extensions

Extensions

extension (message: => String)
def !![X : Loggable](x: => X): X

Method to generate an INFO-level log entry for a (Loggable) value of X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Method to generate an INFO-level log entry for a (Loggable) value of X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Type parameters

X

the type of x, which must provide implicit evidence of being Loggable.

Value parameters

x

the value to be logged.

Attributes

Returns

the value of x.

def !![X : Loggable](xs: => Iterable[X]): Iterable[X]

Method to generate an info log entry for an Iterable of a (Loggable) X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Method to generate an info log entry for an Iterable of a (Loggable) X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Type parameters

X

the underlying type of xs, which must provide implicit evidence of being Loggable.

Value parameters

xs

the Iterable value to be logged.

Attributes

Returns

the value of x.

def !![X : Loggable](xs: => Iterator[X]): Iterator[X]

Method to generate an info log entry for an Iterator of a (Loggable) X. Logging is performed as a side effect. Rendering of the x value is via the logIterable method.

Method to generate an info log entry for an Iterator of a (Loggable) X. Logging is performed as a side effect. Rendering of the x value is via the logIterable method.

Type parameters

X

the underlying type of xs, which must provide implicit evidence of being Loggable.

Value parameters

xs

the Iterator value to be logged.

Attributes

Returns

the value of x.

def !![X : Loggable](xo: => Option[X]): Option[X]

Method to generate an info log entry for an Option of a (Loggable) X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Method to generate an info log entry for an Option of a (Loggable) X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Type parameters

X

the underlying type of x, which must provide implicit evidence of being Loggable.

Value parameters

xo

the optional value to be logged.

Attributes

Returns

the value of x.

def !![K : Loggable, V : Loggable](kVm: => Map[K, V]): Map[K, V]

Method to generate an info log entry for a Map[K, V]. Logging is performed as a side effect.

Method to generate an info log entry for a Map[K, V]. Logging is performed as a side effect.

Type parameters

K

the type of the map keys, which must provide implicit evidence of being Loggable.

V

the type of the map values, which must provide implicit evidence of being Loggable.

Value parameters

kVm

the Map to be logged.

Attributes

Returns

the value of x.

def !![X : Loggable](xf: => Future[X])(implicit evidence$1: Loggable[X], ec: ExecutionContext): Future[X]

Method to generate an info log entry for a Future[X]. Logging is performed as a side effect.

Method to generate an info log entry for a Future[X]. Logging is performed as a side effect.

Type parameters

X

the underlying type of the given input.

Value parameters

xf

the future value to be logged.

Attributes

Returns

the value of xf.

def !!![X](xy: Try[X]): Try[X]

Method to log the value xy (a Try[X]) but which logs any failures using the errorFunction rather than the loggerFunction. NOTE that the returned value, if xy is a Failure, is not exactly the same as xy.

Method to log the value xy (a Try[X]) but which logs any failures using the errorFunction rather than the loggerFunction. NOTE that the returned value, if xy is a Failure, is not exactly the same as xy.

Type parameters

X

the underlying type of xy.

Value parameters

xy

an instance of Try[X].

Attributes

Returns

if xy is successful, then xy, otherwise if Failure(e) then Failure(LoggedException(e)).

def !?[X : Loggable](x: => X): X

Method to generate a DEBUG-level log entry for a (Loggable) value of X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Method to generate a DEBUG-level log entry for a (Loggable) value of X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Type parameters

X

the type of x, which must provide implicit evidence of being Loggable.

Value parameters

x

the value to be logged.

Attributes

Returns

the value of x.

def !?[X : Loggable](xs: => Iterable[X]): Iterable[X]

Method to generate a debug log entry for an Iterable of a (Loggable) X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Method to generate a debug log entry for an Iterable of a (Loggable) X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Type parameters

X

the underlying type of x, which must provide implicit evidence of being Loggable.

Value parameters

xs

the Iterable value to be logged.

Attributes

Returns

the value of x.

def !?[X : Loggable](xo: => Option[X]): Option[X]

Method to generate a debug log entry for an Option of a (Loggable) X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Method to generate a debug log entry for an Option of a (Loggable) X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Type parameters

X

the underlying type of x, which must provide implicit evidence of being Loggable.

Value parameters

xo

the optional value to be logged.

Attributes

Returns

the value of x.

def !?[K : Loggable, V : Loggable](kVm: => Map[K, V]): Map[K, V]

Method to generate a trace log entry for a Map[K, V]. Logging is performed as a side effect.

Method to generate a trace log entry for a Map[K, V]. Logging is performed as a side effect.

Type parameters

K

the type of the map keys, which must provide implicit evidence of being Loggable.

V

the type of the map values, which must provide implicit evidence of being Loggable.

Value parameters

kVm

the Map to be logged.

Attributes

Returns

the value of x.

def !?[X : Loggable](xf: => Future[X])(implicit evidence$1: Loggable[X], ec: ExecutionContext): Future[X]

Method to generate an debug log entry for a Future[X]. Logging is performed as a side effect.

Method to generate an debug log entry for a Future[X]. Logging is performed as a side effect.

Type parameters

X

the underlying type of the given input.

Value parameters

xf

the future value to be logged.

Attributes

Returns

the value of xf.

def !??[X : Loggable](x: => X): X

Method to generate a TRACE-level log entry for a (Loggable) value of X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Method to generate a TRACE-level log entry for a (Loggable) value of X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Type parameters

X

the type of x, which must provide implicit evidence of being Loggable.

Value parameters

x

the value to be logged.

Attributes

Returns

the value of x.

def !??[X : Loggable](xs: => Iterable[X]): Iterable[X]

Method to generate a trace log entry for an Iterable of a (Loggable) X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Method to generate a trace log entry for an Iterable of a (Loggable) X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Type parameters

X

the underlying type of x, which must provide implicit evidence of being Loggable.

Value parameters

xs

the Iterable value to be logged.

Attributes

Returns

the value of x.

def !??[X : Loggable](xo: => Option[X]): Option[X]

Method to generate a trace log entry for an Option of a (Loggable) X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Method to generate a trace log entry for an Option of a (Loggable) X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Type parameters

X

the underlying type of x, which must provide implicit evidence of being Loggable.

Value parameters

xo

the optional value to be logged.

Attributes

Returns

the value of x.

def !??[K : Loggable, V : Loggable](kVm: => Map[K, V]): Map[K, V]

Method to generate a debug log entry for a Map[K, V]. Logging is performed as a side effect.

Method to generate a debug log entry for a Map[K, V]. Logging is performed as a side effect.

Type parameters

K

the type of the map keys, which must provide implicit evidence of being Loggable.

V

the type of the map values, which must provide implicit evidence of being Loggable.

Value parameters

kVm

the Map to be logged.

Attributes

Returns

the value of x.

def !??[X : Loggable](xf: => Future[X])(implicit evidence$1: Loggable[X], ec: ExecutionContext): Future[X]

Method to generate a trace log entry for a Future[X]. Logging is performed as a side effect.

Method to generate a trace log entry for a Future[X]. Logging is performed as a side effect.

Type parameters

X

the underlying type of the given input.

Value parameters

xf

the future value to be logged.

Attributes

Returns

the value of xf.

def !|[X](x: => X): X

Method to generate a log entry for a type which is not itself Loggable. Logging is performed as a side effect. Rendering of the x value is via the toString method.

Method to generate a log entry for a type which is not itself Loggable. Logging is performed as a side effect. Rendering of the x value is via the toString method.

This !| method will be deprecated soon as Loggable is now contravariant in T and there is an implicit def loggableAny[T] which is available.

Type parameters

X

the type of x.

Value parameters

x

the value to be logged.

Attributes

Returns

the value of x.

def debug[X : Loggable](x: => X): X

Synonym for: def !?[X: Loggable](x: => X): X.

Synonym for: def !?[X: Loggable](x: => X): X.

Method to generate a DEBUG-level log entry for a (Loggable) value of X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Type parameters

X

the type of x, which must provide implicit evidence of being Loggable.

Value parameters

x

the value to be logged.

Attributes

Returns

the value of x.

def error[X : Loggable](x: => X)(t: Throwable): X

Method to generate an ERROR-level log entry for a (Loggable) value of X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Method to generate an ERROR-level log entry for a (Loggable) value of X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

NOTE: there is a null coded here for the default value of t. It's justified because it is simply following the Java calling convention.

Type parameters

X

the type of x, which must provide implicit evidence of being Loggable.

Value parameters

t

a Throwable (defaults to null) -- but don't forget the empty parentheses in that case.

x

the value to be logged.

Attributes

Returns

the value of x.

def info[X : Loggable](x: => X): X

Synonym for: def !![X: Loggable](x: => X): X

Synonym for: def !![X: Loggable](x: => X): X

Method to generate an INFO-level log entry for a (Loggable) value of X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Type parameters

X

the type of x, which must provide implicit evidence of being Loggable.

Value parameters

x

the value to be logged.

Attributes

Returns

the value of x.

def trace[X : Loggable](x: => X): X

Synonym for: def !??[X: Loggable](x: => X): X

Synonym for: def !??[X: Loggable](x: => X): X

Method to generate a TRACE-level log entry for a (Loggable) value of X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Type parameters

X

the type of x, which must provide implicit evidence of being Loggable.

Value parameters

x

the value to be logged.

Attributes

Returns

the value of x.

def warn[X : Loggable](x: => X): X

Method to generate a WARN-level log entry for a (Loggable) value of X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Method to generate a WARN-level log entry for a (Loggable) value of X. Logging is performed as a side effect. Rendering of the x value is via the toLog method of the implicit Loggable[X].

Type parameters

X

the type of x, which must provide implicit evidence of being Loggable.

Value parameters

x

the value to be logged.

Attributes

Returns

the value of x.

def |![X](x: => X): X

Method to simply return the value of x without any logging.

Method to simply return the value of x without any logging.

Type parameters

X

the type of x.

Value parameters

x

the value.

Attributes

Returns

the value of x.