igneous-systems/logit — pull request #13 by kevinwallace (2014-09-24 22:43:58+00:00)
Title: Filter log records based on caller's PC, rather than nested logger name

This PR removes `NestedData` and `Expensive`, replacing them with a single `map[string]Level`. The string can be one of three formats, in order of increasing specificity:

* `"path/to/pkg"` filters based on the Go package path of the logger.
* `"path/to/pkg/filename.go"` filters based on the filename of the logger.
* `"path/to/pkg/filename.go:123"` filters based on filename and line number of the logger.

The most specific override targeting a given caller wins. Targeting a specific file or line number is no longer any more expensive than targeting a package.

Callers are recognized by their PC, which is looked up (inexpensively) for every written log record. There is a mapping from PC -> full caller information, lazily populated from the symbol table (less inexpensive; O(log(symtab size))) on the first log call from each caller.

Notably, this PR does not remove nested loggers -- that will happen in a follow-up PR.

Please DO NOT MERGE until the corresponding PR on mesa is ready.