pprint
package pprint
- Alphabetic
- By Inheritance
- pprint
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
trait
Chunker
[T] extends AnyRef
There are a few main classes involved here:
There are a few main classes involved here:
- PPrint: an all-encompassing typeclass that contains all you need to pretty-print a value T => Iter[String]
- PPrinter: a typeclass that takes a configuration object and pretty-prints a value (T, Config) => Iter[String]
- Config: controls various metadata about the pprint, e.g. how wide to go before we start wrapping, or what colors to use
- Chunker: (T, Config) => Iter[ Iter[String] ]. Implements the very common comma-separated-values pattern, where each sub-iter is one of the comma separated blocks, but it's up to the caller to decide what to do with them
- case class Colors (literalColor: Attrs, prefixColor: Attrs) extends Product with Serializable
-
case class
Config
(width: Int = Config.defaultMaxWidth, height: Int = Config.defaultLines, depth: Int = 0, indent: Int = Config.defaultIndent, colors: Colors = pprint.Colors.BlackWhite, renames: Map[String, String] = Config.defaultRenames) extends GenConfig[Config] with Product with Serializable
Configuration options to control how prettyprinting occurs, passed recursively into each prettyprinting callsite.
Configuration options to control how prettyprinting occurs, passed recursively into each prettyprinting callsite.
- width
Controls how far to the right a line will go before it tries to wrap
- height
Controls how many lines can be printed at once. Will print all lines if set to 0
- depth
How much the current item being printed should be indented
- renames
A map used to rename things to more common names, e.g. renamig
WrappedArray
toArray
or getting rid of TupleN *
-
trait
GenConfig
[T <: GenConfig[T]] extends AnyRef
Helpers to help inject behavior into the generated code without having any circular dependencies
-
trait
GenUtils
extends AnyRef
Helpers to help inject behavior into the generated code without having any circular dependencies
- trait LowPriPPrinter extends AnyRef
-
trait
PPrint
[A] extends AnyRef
A typeclass necessary to prettyprint something.
A typeclass necessary to prettyprint something. Separate from PPrinter in order to make contravariant implicit resolution behave right.
-
trait
PPrinter
[-A] extends AnyRef
A typeclass you define to prettyprint values of type A
- trait PPrinterGen extends GenUtils
-
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 TPrintGen [Type[_], Cfg] extends AnyRef
- trait TPrintLowPri extends AnyRef
Value Members
-
def
log[T](value: Text[T], tag: String = "", verbose: Boolean = false)(implicit arg0: PPrint[T], cfg: Config = Config.Colors.PPrintConfig, path: Name, line: Line): Unit
Pretty-prints something to the console for you to look at, with a bunch of additional metadata (function-name, line-num, optional tag, etc.) to make debugging easier
-
def
log2[T](value: Text[T], tag: String = "", verbose: Boolean = false)(implicit arg0: PPrint[T], cfg: Config = Config.Colors.PPrintConfig, path: Enclosing, line: Line): Unit
More verbose version of log
-
def
pprintln[T](t: T, width: Integer = null, height: Integer = null, indent: Integer = null, colors: Colors = null)(implicit arg0: PPrint[T], cfg: Config = Config.Defaults.PPrintConfig): Unit
Pretty-prints something to the console for you to look at.
- def pprintln[T](implicit arg0: PPrint[T], cfg: Config): (T) ⇒ Unit
-
def
stringify[T](t: T, width: Integer = null, height: Integer = null, indent: Integer = null, colors: Colors = null)(implicit arg0: PPrint[T], cfg: Config = Config.Defaults.PPrintConfig): String
Pretty stringify
- def stringify[T](implicit arg0: PPrint[T], cfg: Config): (T) ⇒ String
-
def
tokenize[T](t: T, width: Integer = null, height: Integer = null, indent: Integer = null, colors: Colors = null)(implicit arg0: PPrint[T], cfg: Config = Config.Defaults.PPrintConfig): Iterator[String]
Prettyprint a strongly-typed value, falling back to toString if you don't know what to do with it.
Prettyprint a strongly-typed value, falling back to toString if you don't know what to do with it. Generally used for human-facing output
- def tprint[T](implicit arg0: TPrint[T], config: TPrintColors): String
- object Chunker extends PPrinterGen
- object Colors extends Serializable
- object Config extends Serializable
- object Internals
- object PPrint extends LowPriPPrint
- object PPrinter extends LowPriPPrinter
- object TPrint extends TPrintGen[TPrint, TPrintColors] with TPrintLowPri
- object TPrintColors extends Serializable
- object TPrintLowPri