Private
Loggers
Base.show
— Method.Base.show(::IO, ::Logger)
Just prints Logger(logger.name)
Memento.config
— Method.config(level::AbstractString; fmt::AbstractString, levels::Dict{AbstractString, Int}, colorized::Bool) -> Logger
Sets the Memento._log_levels
, creates a default root logger with a DefaultHandler
that prints to STDOUT.
Arguments
level::AbstractString
: the minimum logging level to log message to the root logger (required).fmt::AbstractString
: a format string to pass to theDefaultFormatter
which describes how to log messages (defaults toMemento.DEFAULT_FMT_STRING
)levels
: the default logging levels to use (defaults toMemento._log_levels
).colorized
: whether or not the message to STDOUT should be colorized.
Returns
Logger
: the root logger.
Memento.get_parent
— Method.get_parent(name::AbstractString) -> Logger
Takes a string representing the name of a logger and returns its parent. If the logger name has no parent then the root logger is returned. Parent loggers are extracted assuming a naming convention of "foo.bar.baz", where "foo.bar.baz" is the child of "foo.bar" which is the child of "foo"
Arguments
name::AbstractString
: the name of the logger.
Returns
Logger
: the parent logger.
Memento.reset!
— Method.reset!()
Removes all registered loggers and reinitializes the root logger without any handlers.
Handlers
Memento.filters
— Method.filters(handler::DefaultHandler) -> Array{Filter}
Returns the filters for the handler.
Memento.setup_opts
— Method.setup_opts(opts) -> Dict
Sets the default :colors if opts[:is_colorized] == true
.
Formatters
Records
Base.Dict
— Method.Dict(rec::Record)
Extracts the Record
and its Attribute
s into a Dict
NOTE: This may be an expensive operations, so you probably don't want to do this for every log record unless you're planning on using every Attribute
.
Memento.Attribute
— Type.Attribute
An Attribute
represents a lazily evaluated field in a log Record
.
Fields
f::Function
: A function to evaluate in order to get a value if one is not set.x::Nullable
: A value that may or may not exist yet.
Memento.Attribute
— Method.Attribute(x)
Simply wraps the value x
in a Nullable
and sticks that in an Attribute
with an empty Function
.
Memento.Attribute
— Method.Attribute(T::Type, f::Function)
Creates an Attribute
with the function and a Nullable
of type T
.
Base.get
— Method.get(attr::Attribute{T}) -> T
Run set attr.x
to the output of attr.f
if attr.x
is not already set. We then return the value stored in attr.x
Memento.from
— Method.from(frame::StackFrame, filter_mod::Module) -> Bool
Returns whether the frame
is from the provided Module
Memento.get_lookup
— Method.get_lookup(trace::Attribute{StackTrace})
Returns the top StackFrame
for trace
if it isn't empty.
Memento.get_msg
— Method.get_msg(msg) -> Function
Wraps msg
in a function if it is a String.
Memento.get_trace
— Method.get_trace()
Returns the StackTrace
with StackFrame
s from the Memento
module filtered out.
IO
Base.flush
— Method.flush(::FileRoller)
Flushes the current open file.
Base.flush
— Method.flush(::Syslog)
Is defined just in case somebody decides to call flush, which is unnecessary.
Base.println
— Method.println(::FileRoller, ::AbstractString)
Writes the string to a file and creates a new file if we've reached the max file size.
Base.println
— Method.println(::Syslog, ::AbstractString, ::AbstractString)
Converts the first AbstractString to a Symbol and call println(::Syslog, ::Symbol, ::AbstractString)
Base.println
— Method.println(::Syslog, ::Symbol, ::AbstractString)
Writes the AbstractString to logger
with the Symbol representing the syslog level.
Memento.getfile
— Method.getfile(folder::AbstractString, prefix::AbstractString) -> String, IO
Grabs the next log file.
Memento.getsuffix
— Method.getsuffix(::Integer) -> String
Formats the nth file suffix.