p

com.tersesystems

blindsight

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. Protected

Package Members

  1. package core
  2. package flow
  3. package fluent
  4. package logstash
  5. package mixins
  6. package ringbuffer
  7. package semantic
  8. package slf4j

Type Members

  1. final class Argument extends AnyVal

    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

    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

    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

    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
  6. trait Condition extends (Level, Markers) => Boolean
  7. class CoreLoggerBenchmark extends AnyRef
    Annotations
    @BenchmarkMode() @OutputTimeUnit() @Warmup() @Measurement() @Fork() @State()
  8. trait DSL extends DSLImplicits

    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)
  9. trait DSLImplicits extends AnyRef
  10. trait DoubleMode extends AnyRef
  11. final case class Entry(marker: Option[Marker], message: String, args: Option[Array[Any]]) extends Product with Serializable

    An underlying statement immediately before being sent to SLF4J.

  12. trait EventBuffer extends AnyRef

    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.

  13. trait EventBufferFactory extends AnyRef
  14. class FlowBenchmark extends AnyRef
    Annotations
    @BenchmarkMode() @OutputTimeUnit() @Warmup() @Measurement() @Fork() @State()
  15. class FluentBenchmark extends AnyRef
    Annotations
    @BenchmarkMode() @OutputTimeUnit() @Warmup() @Measurement() @Fork() @State()
  16. trait Logger extends SLF4JLogger[StrictSLF4JMethod]

    The Blindsight logger trait.

  17. trait LoggerFactory extends AnyRef

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

  18. trait LoggerResolver[T] extends AnyRef

    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.

  19. class LoggingBenchmark extends AnyRef
    Annotations
    @BenchmarkMode() @OutputTimeUnit() @Warmup() @Measurement() @Fork() @State()
  20. trait LowPriorityLoggerResolverImplicits extends AnyRef
  21. trait LowPriorityToArgumentImplicits extends AnyRef
  22. trait LowPriorityToMarkersImplicits extends AnyRef
  23. trait LowPriorityToMessageImplicits extends AnyRef
  24. trait LowPriorityToStatementImplicits extends AnyRef
  25. final class Markers extends AnyRef

    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.

  26. trait MarkersEnrichment extends AnyRef

    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
  27. trait MarkersResolver extends AnyRef

    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.

  28. final class Message extends AnyVal

    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)
  29. class NoOpAppender extends AppenderBase[ILoggingEvent]
  30. sealed trait NotNothing[-T] extends AnyRef
    Annotations
    @implicitNotFound("Nothing was inferred")
  31. class SLF4JLoggerBenchmark extends AnyRef
    Annotations
    @BenchmarkMode() @OutputTimeUnit() @Warmup() @Measurement() @Fork() @State()
  32. final case class SampleMessage(messageType: String) extends Product with Serializable
  33. class SemanticBenchmark extends AnyRef
    Annotations
    @BenchmarkMode() @OutputTimeUnit() @Warmup() @Measurement() @Fork() @State()
  34. trait Statement extends AnyRef

    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.

  35. class StatementBenchmark extends AnyRef
    Annotations
    @BenchmarkMode() @OutputTimeUnit() @Warmup() @Measurement() @Fork() @State()
  36. implicit final class StatementContext extends AnyVal
  37. trait ToArgument[T] extends AnyRef

    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

  38. trait ToMarkers[T] extends AnyRef

    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

  39. trait ToMessage[T] extends AnyRef

    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

  40. trait ToStatement[T] extends AnyRef

    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

  41. class TransformBenchmark extends AnyRef
    Annotations
    @BenchmarkMode() @OutputTimeUnit() @Warmup() @Measurement() @Fork() @State()
  42. class UncheckedBenchmark extends AnyRef
    Annotations
    @BenchmarkMode() @OutputTimeUnit() @Warmup() @Measurement() @Fork() @State()

Value Members

  1. object AST

    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
  3. object ArgumentEnrichment extends ArgumentEnrichment
  4. object ArgumentResolver
  5. object Arguments
  6. object BigDecimalMode extends DSLImplicits with BigDecimalMode
  7. object Condition
  8. object DSL extends DSL with DoubleMode
  9. object DoubleMode extends DSLImplicits with DoubleMode
  10. object EventBuffer
  11. object EventBufferFactory
  12. object Logger
  13. object LoggerFactory
  14. object LoggerResolver extends LowPriorityLoggerResolverImplicits
  15. object Markers
  16. object MarkersEnrichment extends MarkersEnrichment
  17. object MarkersResolver
  18. object Message
  19. object NotNothing
  20. object SampleMessage extends Serializable
  21. object Statement
  22. object ToArgument extends LowPriorityToArgumentImplicits
  23. object ToMarkers extends LowPriorityToMarkersImplicits
  24. object ToMessage extends LowPriorityToMessageImplicits
  25. object ToStatement extends LowPriorityToStatementImplicits
  26. object bobj

Deprecated Value Members

  1. object bodj
    Annotations
    @deprecated
    Deprecated

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

Inherited from AnyRef

Inherited from Any

Ungrouped