A Message
contains all semantic information necessary to easily
comprehend what caused the message to be logged. Each message can be turned
into a Diagnostic
which contains the log level and can later be
consumed by a subclass of Reporter
. However, the error position is only
part of Diagnostic
, not Message
.
NOTE: you should not persist a message directly, because most messages take
an implicit Context
and these contexts weigh in at about 4mb per instance.
Therefore, persisting these will result in a memory leak.
Instead use the persist
method to create an instance that does not keep a
reference to these contexts.
- Value Params
- errorId
a unique id identifying the message, this will later be used to reference documentation online
- Companion
- object
Value members
Abstract methods
The kind of the error message, e.g. "Syntax" or "Type Mismatch". This will be printed as "$kind Error", "$kind Warning", etc, on the first line of the message.
The kind of the error message, e.g. "Syntax" or "Type Mismatch". This will be printed as "$kind Error", "$kind Warning", etc, on the first line of the message.
Concrete methods
Does this message have an explanation?
This is normally the same as explain.nonEmpty
but can be overridden
if we need a way to return true
without actually calling the
explain
method.
Does this message have an explanation?
This is normally the same as explain.nonEmpty
but can be overridden
if we need a way to return true
without actually calling the
explain
method.
A message is non-sensical if it contains references to
A message is non-sensical if it contains references to
The implicit Context
in messages is a large thing that we don't want
persisted. This method gets around that by duplicating the message,
forcing its msg
and explanation
vals and dropping the implicit context
that was captured in the original message.
The implicit Context
in messages is a large thing that we don't want
persisted. This method gets around that by duplicating the message,
forcing its msg
and explanation
vals and dropping the implicit context
that was captured in the original message.