Package

com.tersesystems

blindsight

Permalink

package blindsight

Source
package.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. blindsight
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final class Argument extends AnyVal

    Permalink

    This class represents an argument to a logging statement.

    This class represents an argument to a logging statement.

    Normally this is used in a ToArgument type class instance, and you should not have to use it in a logging statement directly.

    Note that an exception is **not** a valid argument, and exceptions are handled explicitly as java.lang.Throwable in the APIs.

  2. trait ArgumentEnrichment extends AnyRef

    Permalink

    This trait allows a type that has a ToArgument type class instance to render as an Argument.

    This trait allows a type that has a ToArgument type class instance to render as an Argument.

    This is especially useful in the SLF4J API, which does not take a ToMarkers instance.

    import ArgumentEnrichment._
    val argument: Argument = myInstance.asArgument
  3. trait ArgumentResolver extends AnyRef

    Permalink

    Resolves a com.tersesystems.blindsight.AST.BObject to an Argument.

    Resolves a com.tersesystems.blindsight.AST.BObject to an Argument.

    val argument: Argument = ArgumentResolver(bobj("foo" -> "bar"))

    This is a service interface trait, which should be implemented the service loader pattern.

  4. final class Arguments extends AnyVal

    Permalink

    This is the representation of arguments in an SLF4J logging statement.

    This is the representation of arguments in an SLF4J logging statement. It is used to prevent the use of varadic arguments in the SLF4J API, which is a problem for type safety and also causes problems with : _* type ascryption and confused IDEs.

    Arguments present as an immutable API, which can be composed together using + and ++ for sequences.

    val argsA: Arguments = Arguments("a", 1)
    val argsPlus: Arguments = argsA + true
  5. trait BigDecimalMode extends AnyRef

    Permalink
  6. trait Condition extends (Level, Markers) ⇒ Boolean

    Permalink
  7. trait DSL extends DSLImplicits

    Permalink

    A DSL to produce valid AST of values.

    A DSL to produce valid AST of values.

    This is "inspired" by JSON4S code.

    import com.tersesystems.blindsight.AST._
    import com.tersesystems.blindsight.DSL._
    ("name", "joe") ~ ("age", 15) == BObject(BField("name",BString("joe")) :: BField("age",BInt(15)) :: Nil)
  8. trait DSLImplicits extends AnyRef

    Permalink
  9. trait DoubleMode extends AnyRef

    Permalink
  10. final case class Entry(marker: Option[Marker], message: String, args: Option[Array[Any]]) extends Product with Serializable

    Permalink

    An underlying statement immediately before being sent to SLF4J.

  11. trait EventBuffer extends AnyRef

    Permalink

    An event buffer contains events that were about to be logged into SLF4J.

    An event buffer contains events that were about to be logged into SLF4J.

    Event buffers are very useful for testing and for keeping diagnostic log entries for a brief period of time, but may not have 1:1 equivalence with what ends up in the logs.

  12. trait EventBufferFactory extends AnyRef

    Permalink
  13. trait Logger extends SLF4JLogger[StrictSLF4JMethod]

    Permalink

    The Blindsight logger trait.

  14. trait LoggerFactory extends AnyRef

    Permalink

    The logger factory is a trait that returns a Blindsight logger, using a type class instance of LoggerResolver.

  15. trait LoggerResolver[T] extends AnyRef

    Permalink

    The logger resolver is a type class that can return an SLF4J logger from the instance.

    The logger resolver is a type class that can return an SLF4J logger from the instance.

    It should be used with loggerFactory.getLogger.

    It is useful when you want a logger based on something other than a class or string.

  16. trait LowPriorityLoggerResolverImplicits extends AnyRef

    Permalink
  17. trait LowPriorityToArgumentImplicits extends AnyRef

    Permalink
  18. trait LowPriorityToMarkersImplicits extends AnyRef

    Permalink
  19. trait LowPriorityToMessageImplicits extends AnyRef

    Permalink
  20. trait LowPriorityToStatementImplicits extends AnyRef

    Permalink
  21. final class Markers extends AnyRef

    Permalink

    This class represents the markers that are associated with the logging statement.

    This class represents the markers that are associated with the logging statement.

    Normally this is used in a ToArgument type class instance, and you should not have to use it in a logging statement directly.

    Markers represents all added org.slf4j.Marker instances together in an immutable Set, and only at the end wrapped into a marker with markers.marker. This generated marker uses the internal hashcode and contains all the markers in the set as direct children.

    val markers: Markers = Markers(marker)

    Markers does not directly use the SLF4J marker API, as directly mutating markers together as "child references" so that only one marker is available is generally unsafe.

  22. trait MarkersEnrichment extends AnyRef

    Permalink

    This trait allows a type that has a ToMarkers type class instance to render as a Markers.

    This trait allows a type that has a ToMarkers type class instance to render as a Markers.

    This is especially useful in the SLF4J API, which does not take a ToMarkers instance.

    import MarkersEnrichment._
    val markers: Markers = myInstance.asMarkers
  23. trait MarkersResolver extends AnyRef

    Permalink

    Resolves a com.tersesystems.blindsight.AST.BObject to Markers.

    Resolves a com.tersesystems.blindsight.AST.BObject to Markers.

    val markers: Markers = MarkersResolver(bobj("foo" -> "bar"))

    This is a service interface trait, which should be implemented the service loader pattern.

  24. final class Message extends AnyVal

    Permalink

    This class represents the message portion of a logging statement.

    This class represents the message portion of a logging statement.

    A Message is immutable, and so composing a message is a concatenation of Message + Message.

    There is an implicit conversion of string to message, but for general purpose, ToMessage should be used to convert objects.

    val message = Message("foo")
    logger.info(message)
  25. sealed trait NotNothing[-T] extends AnyRef

    Permalink
    Annotations
    @implicitNotFound( "Nothing was inferred" )
  26. trait Statement extends AnyRef

    Permalink

    A statement represents a total logging statement.

    A statement represents a total logging statement. This is most useful for semantic logging, which converts objects to Statement, but is generally helpful in packaging as well.

  27. implicit final class StatementContext extends AnyVal

    Permalink
  28. trait ToArgument[T] extends AnyRef

    Permalink

    This is a type class used to convert given types to Argument.

    This is a type class used to convert given types to Argument.

    case class Person(name: String, age: Int)
    implicit val personToArgument: ToArgument[Person] = ToArgument { person =>
      import net.logstash.logback.argument.StructuredArguments._
      new Argument(keyValue("person", person.name))
    }
    T

    the type to convert to Arguments

  29. trait ToMarkers[T] extends AnyRef

    Permalink

    This is a type class used to convert given types to Markers.

    This is a type class used to convert given types to Markers.

    Markers are very useful for structured logging, because they can be converted into key/value pairs without altering the structure of a message or keeping the ordering in arguments (especially since an exception must be at the end of the tail).

    The API does not define type class instances in this layer, but the logstash package provides many useful mappings to Markers.

    case class Person(name: String, age: Int)
    implicit val personToMarkers: ToMarkers[Person] = ToMarkers { person =>
      val personObj = bobj("name" -> person.name)
      Markers(personObj)
    }
    T

    the type to convert to Markers

  30. trait ToMessage[T] extends AnyRef

    Permalink

    This is a type class used to convert given types to Message.

    This is a type class used to convert given types to Message.

    case class Person(name: String, age: Int)
    implicit val personToMessage: ToMessage[Foo] = ToMessage { person =>
      new Message(person.name)
    }
    T

    the type to convert to Message

  31. trait ToStatement[T] extends AnyRef

    Permalink

    Type class for mapping to a Statement.

    Type class for mapping to a Statement.

    case class Person(name: String, age: Int)
    implicit val personToStatement: ToStatement[Person] = ToStatement { person =>
      Statement(markers = Markers.empty,
                message = Message("Person({}, {})"),
                arguments = Arguments(person.name) + person.age,
                throwable = None)
    }
    T

    the type to convert to a Statement

Value Members

  1. object AST

    Permalink

    The abstract syntax tree.

    The abstract syntax tree. This is used to represent valid structured data, without requiring it to be in a particular format, i.e. JSON, logfmt, or XML. Instead, either MarkersResolver or ArgumentResolver is used to convert from AST to Markers or Argument, respectively.

    A tree is typically constructed by using the DSL.

    import com.tersesystems.blindsight.AST._
    import com.tersesystems.blindsight.DSL._
    
    val o: BObject = bobj("foo" -> "bar")
  2. object Argument

    Permalink
  3. object ArgumentEnrichment extends ArgumentEnrichment

    Permalink
  4. object ArgumentResolver

    Permalink
  5. object Arguments

    Permalink
  6. object BigDecimalMode extends DSLImplicits with BigDecimalMode

    Permalink
  7. object Condition

    Permalink
  8. object DSL extends DSL with DoubleMode

    Permalink
  9. object DoubleMode extends DSLImplicits with DoubleMode

    Permalink
  10. object EventBuffer

    Permalink
  11. object EventBufferFactory

    Permalink
  12. object Logger

    Permalink
  13. object LoggerFactory

    Permalink
  14. object LoggerResolver extends LowPriorityLoggerResolverImplicits

    Permalink
  15. object Markers

    Permalink
  16. object MarkersEnrichment extends MarkersEnrichment

    Permalink
  17. object MarkersResolver

    Permalink
  18. object Message

    Permalink
  19. object NotNothing

    Permalink
  20. object Statement

    Permalink
  21. object ToArgument extends LowPriorityToArgumentImplicits

    Permalink
  22. object ToMarkers extends LowPriorityToMarkersImplicits

    Permalink
  23. object ToMessage extends LowPriorityToMessageImplicits

    Permalink
  24. object ToStatement extends LowPriorityToStatementImplicits

    Permalink
  25. object bobj

    Permalink
  26. package core

    Permalink
  27. package flow

    Permalink
  28. package fluent

    Permalink
  29. package mixins

    Permalink
  30. package semantic

    Permalink
  31. package slf4j

    Permalink

Deprecated Value Members

  1. object bodj

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 1.0.0) This is a typo of bobj (short for bobject)

Inherited from AnyRef

Inherited from Any

Ungrouped