Motivation:
When using the recently re-introduced source-less version of trace, the function parameter that reaches the underlying LogHandler is wrong.
Modifications:
Pass the function parameter to trace with source parameter.
Result:
With these changes, the function parameter that reaches the underlying LogHandler has the correct value.
Motivation:
- When `source:` was added in #135, the API was accidentally broken
despite source compatability.
Modifications:
- Add back source-less API calls which defer to the decls with source.
- Note we can't deprecate the calls we're adding back:
`log.info("some message")` refers to the implementation we're adding
back rather and would therefore require users to explicitly specify a source
to suppress the deprecation warning message.
Result:
- API is no longer broken.
Co-authored-by: Konrad `ktoso` Malawski <ktoso@apple.com>
motivation: we are not actually using symbolicate-linux-fatal in any meaningful way in CI and it's pinned to the master branch which has been removed
changes: remove symbolicate-linux-fatal fetching from Docker
Motivation:
The stream log handler doesn't print metadata in a stable order. While
swift-log is an API package and shouldn't provide all the bells and
whistles for formatting logs, it should make the default log handler
at least somewhat sensible.
Modifications:
- Sort the metadata by key when 'prettifying' it
Result:
- The stream log handler emits logs with metadata in a stable order
- Resolves#128
* =multiplex #139 more properly handle logLevel in multiplex handler
* swift 5.0 needs explicit return
* no need to loop over the settings
* =metadata MultiplexLogHandler now consistently handles metadata read/write
* Apply suggestions from code review
Co-authored-by: Cory Benfield <lukasa@apple.com>
Co-authored-by: George Barnett <gbrntt@gmail.com>
Co-authored-by: Cory Benfield <lukasa@apple.com>
Co-authored-by: George Barnett <gbrntt@gmail.com>
* Update comments in Locks.swift to correctly reflect the Windows implementation and to correctly describe the operation of the `ReadWriteLock`.
* Add error messages to the preconditions on pthread function call return values. Copied from NIO's `Lock` implementation.
* In `Lock`, create the underlying mutex (where applicable) using `PTHREAD_MUTEX_ERRORCHECK`. Copied from NIO's `Lock` implementation. Performance loss is minor on Xenial, Bionic, CentOS, and AmazonLinux; no loss was measurable on Focal at all.
* On Windows, correctly set the `shared` flag in `ReadWriteLock` so the correct `ReleaseSRWLock*()` function is called in `unlock()`. It appears that in practice Windows does not actually care whether the correct release function is called for the type of lock the thread was holding, but this is undocumented (along with most other semantics of `SRWLOCK`) and thus can not be relied upon.
* Fix formatting (that's what I get for copy-pasting from NIO verbatim)
Motivation:
Swift 5.3 will keep `#file` == `#filePath` but starts warning if you
pass `#file` to an argument that's `#filePath` defaulted (XCTest).
Modification:
- Replace `#file` with `(#file)` to silence the warning. In Swift 5.3
`#file` == `#filePath`.
Result:
No warnings
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