88 Commits
Author SHA1 Message Date
Johannes Weiss eba9b323b5 only use shims on swift 4 (#70) 0.0.0 2019-04-26 18:49:53 +01:00
Johannes Weiss 2f65697362 [0.0] refer to docs on master branch. (#68) 2019-04-26 09:47:00 +09:00
tomer doron 9533e02d79 add docker compose setup for swift 4.0 (#47)
motivation: enable ci for swift 4.0 version

changes: add docker compose fil for swift 4.0, ubuntu 16.04
2019-04-15 11:21:15 +01:00
Johannes Weiss d1af77eebd Swift 4 support for a 0.x release
[contains work from @ianpartridge and @weissi]

Motivation:

For an easier migration path, it is probably useful to ship a `0.x`
version of `swift-log` that is compatible with Swift 4. It can't use
any of the features that Swift 5 brings and therefore the Swift 4
version will have a slightly reduced feature set:

- log messages will be `String`
- logging metadata values will be `String` only (no dictionaries,
  arrays, ...)

That means, if you use the Swift 4 version of swift-log carefully
(only use string literals), your migration to the Swift 5 version should
only be a matter of changing your `Package.swift`.

Modifications:

- remove all string interpolation and use `String` directly

Result:

- we can release a 0.x version that supports Swift 4

Support Swift 4.1 (#40)

* Support Swift 4.1

* Set swift-tools-version to 4.0
2019-04-12 15:24:21 +01: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
tomer doron 9a393a5d35 retain SwiftNIO copyright header (#44)
motivation: retain copyrights

changes:
* add notice file with references to derived work
* add swift-nio license header to lock
2019-04-11 14:12:41 +01:00
Johannes Weiss 3924b3b96e readme: fix log levels (#43) 2019-04-10 10:04:51 -07:00
tomer doron 23f0f6ee6e fix typo in API docs (#42)
motivation: better docs

changes: swidft-log -> SwiftLog in an API doc that got it wrong
2019-04-10 18:02:11 +01:00
tomer doron f6a420460d use consistent, swifty naming convention (#41)
motivation: prepare to release

changes: refer to package as SwiftLog across the board isntead of swift-log
2019-04-10 17:45:54 +01:00
Johannes Weiss a64dd7dafc update readme for 1.0.0 (#39) 1.0.0 2019-04-10 16:26:23 +01:00
Johannes Weiss ca922e38f5 remove Logger.metadata property (#36)
Motivation:

Logger had two ways to access the metadata:

    logger[metadataKey: "foo"] = "bar"

and

    logger.metadata["foo"] = "bar"

. The first one is the preferred API (as it doesn't force the
`LogHandler`s to store it in a dictionary) but the second one was still
available for cases where you need to import/export the whole metadata
storage.

Instead of exposing this as a dictionary, we should make the
'whole-metadata import/export' opaque. We're close to tagging 1.0.0
however let's design this API properly and add a sensible implementation
for 1.1.0 or so.

Moditications:

remove `Logger.metadata` property

Result:

- We can design the import/export APIs and add them when they're ready.
- the `LogHandler` API is unchanged
2019-04-08 20:28:10 +01:00
Johannes Weiss 09c2837476 change log levels to be more natural (#35)
Motivation:

The syslog log level was unnatural in order (`.error` < `.info`) but also
didn't have `.trace` and instead the odd `.emergency` and `.alert`.

Modification:

As per https://forums.swift.org/t/logging-levels-for-swifts-server-side-logging-apis-and-new-os-log-apis/20365/56 ,
we decided to go for

    trace < debug < info < notice < warning < error < critical

and also remove the integrals completely. The levels remain comparable
though.

Result:

log levels more natural
2019-04-05 18:42:39 +01:00
Joe Smith 55c927dd31 Add small tweaks to the README. (#30)
* Add small tweaks to the README.
2019-03-27 18:07:34 +00:00
tomer doron 17d1835dac improve doc generation script (#29)
motivation: script did not capture changes correctly

changes: use a temp directory to store state aside before swiftching to gh-page branch
2019-03-26 08:34:17 +00:00
tomer doron 643fdba31a fix linux tests (#28)
motivation: a PR with broken linux tests have been merged

changes: run ./scripts/generate_linux_tests
2019-03-25 17:43:58 -07:00
Abdullah Selek d81e7db5f7 Delete trailing whitespaces. (#26) 2019-03-22 13:37:16 +00:00
pakuchii 870e880fc4 Fix grammar in README (#24) 2019-03-22 09:15:20 +00:00
Seungyeon Lee e65117937a Fix README (#25)
- Update parameter type.
2019-03-22 09:14:46 +00:00
Braden Keith ef8cc5a5d5 Update Readme.md (#23)
Providing an update to the readme that fixes a redundant phrase and some comma splices/omissions.
2019-03-21 18:18:01 +00:00
Johannes Weiss b4dfce827c docs gen script: escape EOF correctly (#21) 2019-03-20 15:56:05 +00:00
Johannes Weiss e60caa9502 improve the LogHandler documentation (#17)
Motivation:

Correct `LogHandler` implementation is very imprortant for a working
swift-log ecosystem. Treating the `logLevel` as a value has lead to
confusion in the discussion leading to this project though.

Modification:

- add documentation on the implementation of a `LogHandler`
- move `LogHandler` to its own file
- add a unit test showcasing a global log level override

Result:

better docs
2019-03-20 15:24:34 +00:00
Kirill Titov 4c01a824b7 Formatting, readability (#15) 2019-03-19 12:24:17 +00:00
Abdullah Selek bee6142a07 Fix for spaces and new line end of file. (#16) 2019-03-19 11:49:20 +00:00
Johannes Weiss 399f98f61f fix docs overview (only one module) (#14) 2019-03-18 19:07:32 +00:00
Johannes Weiss c217b32d46 improve readme (#13) 2019-03-18 18:42:20 +00:00
Johannes Weiss f0a5088707 make MultiplexLogHandler a value (#12) 2019-03-18 18:05:52 +00:00
Johannes Weiss 766ff20cc8 explicitly mark functions on internal types as internal (for jazzy) (#11) 2019-03-18 17:41:13 +00:00
Johannes Weiss 98886523fb first cut at API docs (#8) 2019-03-15 18:26:22 +00:00
Kevin Sweeney 3eba0ff608 Fix typo in README example (#9) 2019-03-15 18:19:03 +00:00
Johannes Weiss 284bf1fdeb switch #file/#function to String (#4)
Motivation:

With the new, awesome Swift 5 `String`s, there doesn't seem to be any
point in using `StaticString`s anymore. `String` seems to use immortal
strings for literals now and is in fact 1 byte less wide than
StaticString.

Modification:

Switch all StaticString for String

Result:

better asm (slightly shorter), fewer registers burnt, more features
2019-03-14 11:32:08 +00:00
Johannes Weiss 1039ca5db2 StdoutHandler: add colon after log level (#5) 2019-03-14 11:31:56 +00:00
tomer doron 94caaf2910 docker setup and linux tests (#7)
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
2019-03-14 11:31:47 +00:00
Johannes Weiss 3f53e0ab50 README: first cut (#6) 2019-03-13 22:27:50 +00:00
Johannes Weiss 46735c242a Package.swift: rename to swift-log 2019-03-07 18:33:20 +00:00
Johannes Weiss 78b84e39ff address #2: provide an example logging a String (#3)
- fixes #2
2019-03-05 19:44:46 +00:00
Johannes Weiss 7dd7738627 allow string interpolations in log messages 2019-03-01 10:59:17 +00:00
Johannes Weiss 306f432f6c convert to struct Logger.Message from String 2019-02-26 11:19:58 +00:00
Johannes Weiss c693fb6db1 switch to syslog log levels 2019-02-26 09:57:44 +00:00
Johannes Weiss 6254844827 remove examples, add code of conduct, Swift 5 2019-02-26 09:06:55 +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
tomer doron 045ba36718 remove error argument from logging API (#34)
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
2019-02-22 18:02:14 +00:00
Thomas Krajacic 9bd90f06ba Add label to Logger (#50) 2019-02-22 14:43:11 +00:00
Johannes Weiss 45c6d10678 rename Logging to LoggingSystem (#49) 2019-02-22 13:38:22 +00:00
tomer doron aa3990dfa0 support custom logging factories (#33)
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
2019-02-22 13:28:41 +00:00
Konrad `ktoso` Malawski b0e59933ac Allow carrying CustomStringConvertible in metadata #24 (#25)
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.
2019-02-19 12:17:42 +00:00
Thomas Krajacic 5c135cd948 Add O_APPEND to flags (#45) 2019-02-19 11:44:24 +00:00
Johannes Weiss 32e9fa5158 make log function public (#44) 2019-02-19 11:43:51 +00:00
Thomas Krajacic 1b17eac10e Add newline to String being written (#47) 2019-02-19 11:01:59 +00:00
Johannes Weiss 034334268a fix the build (#43) 2019-02-19 08:50:55 +00:00