This is a potential crate that would simplify the use of the example-lib pattern for slog.
The motivation is the same as that of the example-lib:
a library using slog for its logging would like to accept a parent logger if the crate pulling it in is using slog,
or fall back to interfacing with log's static logger if not.
At any entry point to your library's interface, you would retrieve the Logger from your lazy slog.
After that point, you would pass it around and create child loggers like normal.
This pattern using lazy_static and a DoubleCheckedCell is to support building a library whose ergonomic interface
is free functions rather than structs, which can more directly take loggers from their parent logical scope.
The only two issues I see with this approach is a) an extra two pointer chases to get to your Logger and
b) what happens if your library is depended on from two locations in the tree? Then you'll get your logger
set twice.
The problem is that this is effectively bringing in the idea of a global logger again,
but this time bound to your crate rather than a code stack scope.
As always, if you're making an internal library and you know the consumer is using slog,
just pass the logger around like you do for normal strucured logging.