Private

Private

Loggers

Base.showMethod.
Base.show(::IO, ::Logger)

Just prints Logger(logger.name)

source
Memento.configMethod.
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 the DefaultFormatter which describes how to log messages (defaults to Memento.DEFAULT_FMT_STRING)

  • levels: the default logging levels to use (defaults to Memento._log_levels).

  • colorized: whether or not the message to STDOUT should be colorized.

Returns

  • Logger: the root logger.

source
Memento.get_parentMethod.
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.

source
Memento.reset!Method.
reset!()

Removes all registered loggers and reinitializes the root logger without any handlers.

source

Handlers

Memento.filtersMethod.
filters(handler::DefaultHandler) -> Array{Filter}

Returns the filters for the handler.

source
Memento.setup_optsMethod.
setup_opts(opts) -> Dict

Sets the default :colors if opts[:is_colorized] == true.

source

Formatters

Records

Base.DictMethod.
Dict(rec::Record)

Extracts the Record and its Attributes 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.

source
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.

source
Memento.AttributeMethod.
Attribute(x)

Simply wraps the value x in a Nullable and sticks that in an Attribute with an empty Function.

source
Memento.AttributeMethod.
Attribute(T::Type, f::Function)

Creates an Attribute with the function and a Nullable of type T.

source
Base.getMethod.
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

source
Memento.fromMethod.
from(frame::StackFrame, filter_mod::Module) -> Bool

Returns whether the frame is from the provided Module

source
Memento.get_lookupMethod.
get_lookup(trace::Attribute{StackTrace})

Returns the top StackFrame for trace if it isn't empty.

source
Memento.get_msgMethod.
get_msg(msg) -> Function

Wraps msg in a function if it is a String.

source
Memento.get_traceMethod.
get_trace()

Returns the StackTrace with StackFrames from the Memento module filtered out.

source

IO

Base.flushMethod.
flush(::FileRoller)

Flushes the current open file.

source
Base.flushMethod.
flush(::Syslog)

Is defined just in case somebody decides to call flush, which is unnecessary.

source
Base.printlnMethod.
println(::FileRoller, ::AbstractString)

Writes the string to a file and creates a new file if we've reached the max file size.

source
Base.printlnMethod.
println(::Syslog, ::AbstractString, ::AbstractString)

Converts the first AbstractString to a Symbol and call println(::Syslog, ::Symbol, ::AbstractString)

source
Base.printlnMethod.
println(::Syslog, ::Symbol, ::AbstractString)

Writes the AbstractString to logger with the Symbol representing the syslog level.

source
Memento.getfileMethod.
getfile(folder::AbstractString, prefix::AbstractString) -> String, IO

Grabs the next log file.

source
Memento.getsuffixMethod.
getsuffix(::Integer) -> String

Formats the nth file suffix.

source