19 Commits
Author SHA1 Message Date
Vladimir Kukushkin a90a3d1c37 Migrate from XCTest to Swift Testing (#382)
Migrating `swift-log` from XCTest to Swift Testing

### Motivation

Swift Testing is a modern alternative to XCTest. Swift Server Ecosystem
packages should serve as reference implementations for modern Swift
features and best practices.

### Modifications

- 1-to-1 migration of test suites, tests, and assertions to Swift
Testing syntax with XCTest import removed
- XCTest references removed from documentation
- `.trace` log level added to relevant tests
- `GlobalLoggerTest` suite serialized to handle global `LoggingSystem`
access (XCTest runs tests serially by default; Swift Testing runs in
parallel, so serializing this suite avoids requiring `swift test
--no-parallel` across all CI and development environments)

### Result

Successfully executes 52 tests with `swift test --disable-xctest`.
2025-10-23 13:57:49 +01:00
Vladimir KukushkinandHonza Dvorsky 2a4139ef2a Drop Swift 5.9 and 5.10 support (#383)
Make Swift 6.0 the minimum support version.

### Motivation:

`swift-log` supports 3 latest Swift releases, which is at this point
6.0, 6.1 and 6.2. Swift 5 is no longer supported.

### Modifications:

- Package.swift swift tools
- CI configs
- Imports checking if compiler is <6.0

### Result:

Swift 5 is no longer supported.

Co-authored-by: Honza Dvorsky <honza@apple.com>
2025-10-23 09:22:00 +01:00
Franz Busch ee1bfd3f47 [CI] Migrate to GHA (#328)
# Motivation

We want to modernize our CI.

# Modification

This PR migrates to GH actions and turns on all the right flags.

# Result

Modern CI.
2024-10-30 13:17:15 +00:00
Peter Adams 6553ef5893 Add Sendability annotations (#308)
Motivation:

This becomes a critical feature in swift 6.

Modifications:

Add Sendability annotations where required.
Factor out code protected by locks.

Result:

Compiles without warnings with Sendability checking
2024-06-18 08:28:58 -07:00
Johannes Weiss c37c434930 add source for log messages 2020-07-06 20:01:11 +09:00
tomer doron 263735081c test formatting issues as part of sanity check (#84)
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
2019-07-30 13:34:00 -07:00
David Okun a4828d9184 Added CaseIterable to Logger.Level enum (#46)
* Added CaseIterable to Logger.Level enum
2019-04-12 14:49:25 +01:00
Johannes Weiss c693fb6db1 switch to syslog log levels 2019-02-26 09:57:44 +00:00
Johannes Weiss 7db09d7d68 add license information (#48) 2019-02-24 13:51:38 +00:00
tomer doron c7583429a6 enforce that logging system can only be bootstrapped once (#32)
motivation: safer logging system

changes: do a precondition check to verify logging syste is only initialized/bootstrapped once per process
2019-02-22 18:13:52 +00:00
Johannes Weiss 45c6d10678 rename Logging to LoggingSystem (#49) 2019-02-22 13:38:22 +00:00
Johannes Weiss 034334268a fix the build (#43) 2019-02-19 08:50:55 +00:00
David Hart 2474d61a80 Multiple proposal improvements to the API (#41)
* Move `Logging.make` to a `Logger` initializer.
* Remove all factory initializers in example and test code.
2019-02-18 20:27:59 +01:00
tomer doron 19d987b6d5 add logger API variants that take an error (#12)
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
2019-01-08 20:41:03 +00:00
Johannes Weiss c7ac24db1f nest types & allow nested metadata 2019-01-08 18:13:52 +00:00
tomer doron 9027df5f03 refactor examples and remove dependecy on foundation
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
2019-01-05 02:03:44 -08:00
Johannes Weiss ed535d4ec8 test value property in local logger 2018-12-12 17:53:04 +00:00
Johannes Weiss 50a8c8fdac use the term "metadata" 2018-12-12 17:43:59 +00:00
tomer doron b5dcb3140e naming proposal (#2)
* naming proposal

motivation: intuitive APIs

changes:
* Logger is the main API users interact with
* Logging is the factory from which users get instances of Logger, via Logging.for(identifer)
* LogHandler is what logging libraries implement, this is not exposed to users as its boxed in Logger
* replace Logging (aka LoggerFactory) factory property with bootstrap(factory) function
* rename main module to Logging since its not server only
* converge examples into an Examples module

open questions:
* Logging.make or Logging.for
* is Logging.for(object: Any.Type) a good idea? is there a better way to get the FQN for an object?
2018-12-10 15:11:03 -08:00