import "go.chromium.org/luci/common/logging/memlogger"
Dump is a convenience function to dump the current contents of the memory logger to the writer.
This will panic if the current logger is not a memory logger.
MustDumpStdout is a convenience function to dump the current contents of the memory logger to stdout.
This will panic if the current logger is not a memory logger.
Reset is a convenience function to reset the current memory logger.
This will panic if the current logger is not a memory logger.
ShouldHaveLog is a goconvey custom assertion which asserts that the logger has received a log. It takes up to 3 arguments. argument 1 (expected[0]) is the log level. argument 2 (expected[1]) is a substring the message. If omitted or the empty string, this value is not checked. argument 3 (expected[2]) is the fields data. If omitted or nil, this value is not checked.
ShouldNotHaveLog is the inverse of ShouldHaveLog. It asserts that the logger has not seen such a log.
Use adds a memory backed Logger to Context, with concrete type *MemLogger. Casting to the concrete type can be used to inspect the log output after running a test case, for example.
LogEntry is a single entry in a MemLogger, containing a message and a severity.
type MemLogger struct {
// contains filtered or unexported fields
}
MemLogger is an implementation of Logger. Zero value is a valid logger.
Debugf implements the logging.Logger interface.
Dump dumps the current memory logger contents to the given writer in a human-readable format.
Errorf implements the logging.Logger interface.
Get returns the first matching log entry. Note that lvl, msg and data have to match the entry precisely.
GetFunc returns the first matching log entry.
Has returns true iff the MemLogger contains the specified log message. Note that lvl, msg and data have to match the entry precisely.
HasFunc returns true iff the MemLogger contains a matching log message.
Infof implements the logging.Logger interface.
LogCall implements the logging.Logger interface.
Messages returns all of the log messages that this memory logger has recorded.
Reset resets the logged messages recorded so far.
Warningf implements the logging.Logger interface.
Package memlogger imports 8 packages (graph) and is imported by 7 packages. Updated 2019-11-14. Refresh now. Tools for package owners.