pprint
package pprint
Contains a convenient default pre-configured PPrinter.
Hard-coded and inflexible, but feel free to instantiate your own PPrint if you want to customize it.
- Alphabetic
- By Inheritance
- pprint
- PPrinter
- Serializable
- Product
- Equals
- Walker
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- case class PPrinter(defaultWidth: Int = 100, defaultHeight: Int = 500, defaultIndent: Int = 2, defaultEscapeUnicode: Boolean = false, defaultShowFieldNames: Boolean = true, colorLiteral: Attrs = fansi.Color.Green, colorApplyPrefix: Attrs = fansi.Color.Yellow, additionalHandlers: PartialFunction[Any, Tree] = PartialFunction.empty) extends Walker with Product with Serializable
- defaultWidth
How wide to allow a pretty-printed value to become before wrapping
- defaultHeight
How tall to allow the pretty-printed output to become before truncated it with a
...
- defaultIndent
How many spaces to indent each nested Tree.Apply by
- colorLiteral
What color to assign to literals like
"lol"
or 31337- colorApplyPrefix
What color to assign to
Foo
inFoo(bar, baz)
- additionalHandlers
Provide this to override how certain types are pretty-printed at runtime
- class Renderer extends AnyRef
- class Result extends AnyRef
The intermediate return type of the pretty-print system: provides an iterator which produces the actual string output, as well as metadata around that output that is only available after the iterator is exhausted
- trait TPrint[T] extends AnyRef
Summoning an implicit
TPrint[T]
provides a pretty-printed string representation of the typeT
, much better than is provided by the defaultType#toString
.Summoning an implicit
TPrint[T]
provides a pretty-printed string representation of the typeT
, much better than is provided by the defaultType#toString
. In particular- More forms are properly supported and printed - Prefixed Types are printed un-qualified, according to what's currently in scope
- case class TPrintColors(typeColor: Attrs) extends Product with Serializable
- trait TPrintLowPri extends AnyRef
- sealed trait Tree extends AnyRef
A lazy AST representing pretty-printable text.
A lazy AST representing pretty-printable text. Models
foo(a, b)
foo op bar
, and terminalsfoo
in both lazy and eager forms - class Truncated extends Iterator[Str]
Wraps an input iterator of colored fansi.Strs, and produces the same fansi.Strs but truncated once the wrapped-at-width text reaches beyond a certain height
- abstract class Walker extends AnyRef
Abstract Value Members
- abstract def additionalHandlers: PartialFunction[Any, Tree]
- Definition Classes
- Walker
- abstract def canEqual(that: Any): Boolean
- Definition Classes
- Equals
- abstract def getClass(): Class[_ <: AnyRef]
- Definition Classes
- Any
- abstract def productArity: Int
- Definition Classes
- Product
- abstract def productElement(n: Int): Any
- Definition Classes
- Product
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- def apply(x: Any, width: Int = defaultWidth, height: Int = defaultHeight, indent: Int = defaultIndent, initialOffset: Int = 0, escapeUnicode: Boolean = defaultEscapeUnicode, showFieldNames: Boolean = defaultShowFieldNames): Str
Converts an Any into a large colored
fansi.Str
Converts an Any into a large colored
fansi.Str
- Definition Classes
- PPrinter
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- val colorApplyPrefix: Attrs
- Definition Classes
- PPrinter
- val colorLiteral: Attrs
- Definition Classes
- PPrinter
- val defaultEscapeUnicode: Boolean
- Definition Classes
- PPrinter
- val defaultHeight: Int
- Definition Classes
- PPrinter
- val defaultIndent: Int
- Definition Classes
- PPrinter
- val defaultShowFieldNames: Boolean
- Definition Classes
- PPrinter
- val defaultWidth: Int
- Definition Classes
- PPrinter
- def equals(arg0: Any): Boolean
- Definition Classes
- Any
- def hashCode(): Int
- Definition Classes
- Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def log[T](x: Text[T], tag: String = "", width: Int = defaultWidth, height: Int = defaultHeight, indent: Int = defaultIndent, escapeUnicode: Boolean = defaultEscapeUnicode, showFieldNames: Boolean = defaultShowFieldNames)(implicit line: Line, fileName: FileName): T
Logs a given value to stdout with some metadata to identify where the log message came from.
Logs a given value to stdout with some metadata to identify where the log message came from. Hard-coded and not very flexible, but you can easily implement your own log method if you want to customize it further.
- Definition Classes
- PPrinter
- def pprintln[T](x: T, width: Int = defaultWidth, height: Int = defaultHeight, indent: Int = defaultIndent, initialOffset: Int = 0, escapeUnicode: Boolean = defaultEscapeUnicode, showFieldNames: Boolean = defaultShowFieldNames): Unit
Converts an Any into a large colored
fansi.Str
Converts an Any into a large colored
fansi.Str
- Definition Classes
- PPrinter
- def productElementName(n: Int): String
- Definition Classes
- Product
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def productIterator: Iterator[Any]
- Definition Classes
- Product
- def productPrefix: String
- Definition Classes
- Product
- def toString(): String
- Definition Classes
- Any
- def tokenize(x: Any, width: Int = defaultWidth, height: Int = defaultHeight, indent: Int = defaultIndent, initialOffset: Int = 0, escapeUnicode: Boolean = defaultEscapeUnicode, showFieldNames: Boolean = defaultShowFieldNames): Iterator[Str]
Converts an Any into an iterator of colored chunks, wrapped at a certain width and truncated at a certain height
Converts an Any into an iterator of colored chunks, wrapped at a certain width and truncated at a certain height
- Definition Classes
- PPrinter
- def tprint[T](implicit arg0: TPrint[T], config: TPrintColors): Str
- def treeify(x: Any, escapeUnicode: Boolean, showFieldNames: Boolean): Tree
- Definition Classes
- Walker
- val tuplePrefix: String
- Definition Classes
- Walker
- object PPrinter extends Serializable
- object ProductSupport
- object Renderer
- object Result
- object StringPrefix
- object TPrint extends TPrintLowPri
- object TPrintColors extends Serializable
- object TPrintLowPri
- object Tree
- object Util