Logging

object Logging

Facilities for on-the-side logging of either encoding or decoding progress, which can be useful for debugging problems with the input or custom codec logic.

Logging can be done either before or after the input validation step, depending on your needs. If unsure, go for after-validation logging, at least initially. (This is also the default.) For example, to log decoding progress to the console you can say:

Cbor.decode(inputBytes).withPrintLogging().to[MyType]
class Object
trait Matchable
class Any
Logging.type

Type members

Classlikes

Companion:
class
sealed trait ElementType
Companion:
object
trait LevelInfo
abstract class LineFormatLogger extends Logger

A Logger which formats each incoming element to it's own log line.

A Logger which formats each incoming element to it's own log line.

trait Logger
class PrintLogger(val info: LevelInfo, val maxShownByteArrayPrefixLen: Int, val maxShownStringPrefixLen: Int, val maxShownArrayElems: Int, val maxShownMapEntries: Int, val initialGutterWidth: Int, val renderLevelCount: Boolean, val renderEndOfInput: Boolean, val renderCommas: Boolean, val indentation: String, val mapKeySep: String) extends LineFormatLogger

A LineFormatLogger that simply prints all lines to the console.

A LineFormatLogger that simply prints all lines to the console.

final class Receiver(target: Receiver, createLogger: LevelInfo => Logger) extends Receiver with LevelInfo

A Receiver which forwards all incoming data item to another Receiver and, on the side, feeds a custom Logger with logging events.

A Receiver which forwards all incoming data item to another Receiver and, on the side, feeds a custom Logger with logging events.

class ToStringLogger(val info: LevelInfo, val stringBuilder: StringBuilder, val maxShownByteArrayPrefixLen: Int, val maxShownStringPrefixLen: Int, val maxShownArrayElems: Int, val maxShownMapEntries: Int, val initialGutterWidth: Int, val renderLevelCount: Boolean, val renderEndOfInput: Boolean, val renderCommas: Boolean, val indentation: String, val mapKeySep: String, val lineSep: String, val mapValueOnNewLine: Boolean) extends LineFormatLogger

A LineFormatLogger that appends all lines to a given JStringBuilder.

A LineFormatLogger that appends all lines to a given JStringBuilder.

Value members

Concrete methods

def transformer[Config](createLogger: LevelInfo => Logger): () => Config