PassiveSupport.Logging (passive_support v0.8.1)
Helper functions for logging and inspecting.
These functions serve two primary purposes:
- To keep outputs colorized even when they're sent to Logger,
- To keep
IO.inspectandKernel.inspectfrom truncating away data you might need if you intend, e.g., to save a function's return as fixture data for debugging purposes
Link to this section Summary
Functions
Pretty good, pretty pretty, color choices for inspected data
calls Kernel.inspect/2 on item with logger_opts/0.
Sensible defaults for IO.inspect and Kernel.inspect when you want to see a value in its entirety
Sensible option defaults for logging information to stdout
Link to this section Functions
alert(item \\ nil, label \\ nil)
coloration_opts()
Specs
coloration_opts() ::
{:syntax_colors,
[
number: :yellow,
string: :green,
list: :light_magenta,
map: :light_cyan,
atom: :light_blue,
tuple: :"[:black_background, :white]",
regex: :"[:cyan_background, :light_yellow]"
]}
Pretty good, pretty pretty, color choices for inspected data
critical(item \\ nil, label \\ nil)
debug(item \\ nil, label \\ nil)
emergency(item \\ nil, label \\ nil)
error(item \\ nil, label \\ nil)
info(item \\ nil, label \\ nil)
inspect(item, to_log \\ false)
calls Kernel.inspect/2 on item with logger_opts/0.
If you wish to overwrite some portion of the opts send to inspect,
consider calling Kernel.inspect and passing Utils.logger_opts() ++ overwrites as your opts instead of calling this function.
inspect_opts()
Specs
inspect_opts() :: [ printable_limit: :infinity, limit: :infinity, width: 170, pretty: true ]
Sensible defaults for IO.inspect and Kernel.inspect when you want to see a value in its entirety
logger_opts()
Specs
logger_opts() :: [
syntax_colors: [
number: :yellow,
string: :green,
list: :light_magenta,
map: :light_cyan,
atom: :light_blue,
tuple: :"[:black_background, :white]",
regex: :"[:cyan_background, :light_yellow]"
],
printable_limit: :infinity,
limit: :infinity,
width: 170,
pretty: true
]
Sensible option defaults for logging information to stdout