motivation: prepare to release
changes:
* add docker setup
* fix tests to pass correctly on linux
* add sanity scripts to make sure linux tests are present
* add doc generation scripts
* fix few naming mistakes in collateral
motivation: since Error in swift does not carry any additional information (such as stack traces) that can be useful in formatting decision the LogHandler may need to do, there is no real reason to treat it as special in the API, and it can just be "strigified" at the calling site
changes: remove error params from all APIs
motivation: make the API flexible enough so that users that need to inject custom factories as an escape hatch can do that
changes: add a Logging::make API variant that takes a custom factory instead of the default one
This has numerous benefits, most of which center around values which may
have expensive to perform custom `description` implementations, e.g.
yet are neither a dictionary nor an array.
It also allows carrying and thus "delaying" rendering of string
representations until they are actually needed. E.g. one can imagine
wanting to avoid rendering a string representation of a value if a
logger never would log any of the metadata, esp. if the rendering is a
heavy process.
motivation: better example
changes: the exmaple is single threaded, but better to show how to properly use global loggers (although we discourage them)
Motivation:
Two reasons for the removal:
1. I don't see a compelling reason to add lazy metadata to the metadata
storage. Lazy metadata makes sense if it's passed directly to a log
method like
logger.info("foo", metadata: somethingExpensive())
but I don't think this makes a whole lot of sense
logger[metadataKey: "foo"] = .lazy({ somethingExpensive() })
why? It's very likely that it'll get evalutated because any next
log message that gets logged will force it but it's totally
unclear which one that'll be.
2. More importantly, the lazy metadata can't be implemented correctly
because we can't memoize the result of the expensive computation
because we can only mutate the `LogHandler` in mutating methods and
the log methods aren't mutating.
motivation: allow users to define metadata at the log API call site
changes: add metadata param to all log APIs, and implement merge at our example implementations
motivation: easily log errors w/o converting them to string first
changes:
* add another set of logger APIs that take in an error object
* add tests and refactor testing assertions
* add autoclosure tests to make sure its resoved on when log level is appropriate
motivation:
* due to the low level nature of the library we prefer not to force-load foundation
* help reviewers diffrentiate between examples of usage vs implementation, and add more realistic usage and implementations examples
changes:
* remove foundation from Logging module, replace with c based locks and time functions
* rewrite usage examples to be more realistic
* add example of an implementation that writes to files
* add example of an implementation that is config driven
* rename warn -> warning
motivation: support situations when users want to multiplex to multiple logging implementations
changes:
* add MultiplexLogging (factory) and MUXLogHandler (implementation), allowing user to plug in multiple logging implementations
* add tests and examples to demonstrate the functionality