Motivation:
The current docstring seems to be missing some words that indicate
when a 'trace' log level is more appropriate than a 'debug' log
level. This was brought up in https://github.com/vapor/docs/issues/463
and has been fixed there. This PR is being submitted to the upstream
project as a courtesy.
Modifications:
This PR adds a clause to the docstring of the 'trace' log level to
clearly indicate when this log level shuld be used.
Result:
The docstring for the 'trace' log level will mirror the structure of
the docstring for the 'debug' log level, but will include a clear
opinion of when the 'trace' log level is appropriate.
Signed-off-by: zach wick <zach@zachwick.com>
Motivation:
SwiftLog is meant as a base logging library so users will often overload
certain functions with their own specialised and opinionated overloads.
Modification:
Add a test as demonstration.
Result:
More tests.
motivation: docs scripts is broken on selinux due to restriction on ssh-agent
changes: change the jazzy worksapce to a directory accessible by the CI node so we can push from the agent instead of from the docker container
The README file links to an implementation of a backend that uses os_log.
However, the backend always uses `%{public}@` as the format string and
eagerly converts all string interpolations to Strings. This has two drawbacks:
1. the static components of the string interpolation would be eagerly copied by
the unified logging system, which will result in loss of performance.
2. It also changes the default privacy scheme used by os_log and make all message
private, which runs the risk of no message getting logged. Update the
README to capture this drawback. Also, link to the on-going effort on
improving os_log Swift APIs and aligning it with swift-log.
motivation: more secured ci setup
changes:
* enable :z selinux flag on bind mounts so we can enable selinux on ci
* drop potentially exploitable capabilities from docker-compose
motivation: better ci testing
changes:
* add api breakage script to test api breakage in ci
* add "shell" utility docker-compose task to run api breakage script
* change test task to treat warning as errors
* prepare to test with thread sanitizer in 5.1
motivation: support swift 5.1
changes:
* add docker compose file for swift 5.1, will add CI job once merged
* update swiftformat version to 0.40.12
* fix warning in tests
* add flush api to default stdout/stderr logger
motivation: default logger may not flush the streams on crush, so need to make flushing moe explicit
changes:
* add a constructor argument to control flushing behaviour, default to "everytime"
* add a "flush" method to allow user defined flush timing. this api is now internal but we could expose it if there is a need
* add tests
* fixup
* better documentation around MetadataValue being expressible by literals
Motivation:
In many examples, I could see that users seem to construct metadata
values using the explicit enum cases `.string("foo")`, `.array(...)`, as
well as `.dictionary(...)`. It's much more readable and easier to type
to just use `"foo"`, `["bar", "buz"]`, and `["qux": "quux"]` and rely on
the `ExpressibleBy...Literal` conformances.
Modifications:
Add the docs and examples.
Result:
Hopefully, users will read the docs and write more idiomatic code.
* Update Logging.swift
motivaiton: unified format
changes:
* use official docker image 🎉
* fix outstanding formatting issues
* add a call to swiftformat as part of sanity script
* fix sanity script language check debugging statements
LoggingFormatAndPipe provides a Swift Logging API Handler which allows you to customized both your log messages' formats as well as their destinations.
motivation: @ianpartridge implemented a backend for syslog (awesome :-)) so we should link to it so people are easily able to discover it (and any other future implementations we'd want to link to).
Expose `StreamLogHandler` to the public which replaces the previously internal `StdoutLogHandlers`. Users can choose now the output stream, while `stdout` is the default.
### Motivation:
As discussed on #51 and #60
### Modifications:
Rename `StdoutLogHandler` to `StreamLogHandler` and provide 2 factory methods `standardOutput(label:)` and `standardError(label:)` for using during bootstrapping.
### Result:
Users who adopt other logging backends during `LoggingSystem` bootstrapping will still be able to use the default log handler to get very basic console output to their choice of `stdout` or `stderr`.
### Example:
```
// Log to both stderr and stdout for good measure
LoggingSystem.bootstrap {
MultiplexLogHandler([
FancyLoggingBackend(label: $0),
StreamLogHandler.standardError(label: $0),
StreamLogHandler.standardOutput(label: $0)
])
}
```
Motivation:
Users ask for a CocoaPod. Unfortunately, the CocodPod `SwiftLog` is
already taken, so I went for `SwiftLogAPI`.
Modification:
Add a podspec generator.
Result:
Happier users.
Motivation:
Allowing readers of the API documentation to drill into the implementation of documented declarations can be educational and helpful for debugging, among several other reasons.
Modifications:
Add --github-file-prefix appending the current version in order to keep stable links. This means that documentation generated from any non-release revision may resolve incorrectly. This can be refined in the doc generation script later if it is deemed problematic by resolving to the commit sha if it doesn't exactly align with the version.
Result:
Users will be able to click a 'Show on GitHub' for all documented API declarations.
motivation: use consistent formatting
changes: update generate_linux_tests to match the formatting rules we use: `swiftformat --self insert --patternlet inline --stripunusedargs unnamed-only --comments ignore`