popcorn :: PopFormatter :: defaultinit
popcorn :: PopFormatter :: no_color=
Do not decorate messages with colorspopcorn $ PopFormatter :: SELF
Type of this instance, automatically specialized in every classcore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
logger :: Formatter :: defaultinit
core :: Object :: defaultinit
popcorn :: PopFormatter :: defaultinit
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
popcorn :: PopFormatter :: no_color=
Do not decorate messages with colorscore :: Object :: output_class_name
Display class name on stdout (debug only).
class PopFormatter
super Formatter
# Do not decorate messages with colors
var no_color = false is optional, writable
redef fun format(level, message) do
var string = message.write_to_string
if level == fatal_level then
string = "[FATAL] {string}"
else if level == error_level then
string = "[ERROR] {string}"
else if level == warn_level then
string = "[WARN] {string}"
else if level == info_level then
string = "[INFO] {string}"
else if level == debug_level then
string = "[DEBUG] {string}"
end
if no_color then return string
if level == fatal_level then
return string.red
else if level == error_level then
return string.red
else if level == warn_level then
return string.yellow
else if level == info_level then
return string.blue
else if level == debug_level then
return string.gray
end
return string
end
end
lib/popcorn/pop_logging.nit:58,1--95,3