Commit Graph

15 Commits

Author SHA1 Message Date
Alexandre Boulgakov
5450585c1c Swift: Remove SwiftDiagnostic constructor (C++20 todo). 2023-06-08 13:11:14 +01:00
Alexandre Boulgakov
8f7279ee05 Swift: TSP message wording changes. 2023-05-19 14:39:57 +01:00
Paolo Tranquilli
42d40900d3 Swift: reword TSP diagnostics after doc team review 2023-05-16 17:52:02 +02:00
Paolo Tranquilli
8291b2229a Swift: turn internal error into a TSP warning 2023-05-16 15:18:29 +02:00
Paolo Tranquilli
cfcd26cf0d Swift: support markdown TSP diagnostics 2023-05-15 13:48:24 +02:00
Paolo Tranquilli
03f4625b5f Swift: go back to explicit DIAGNOSE_ERROR macros 2023-05-12 06:30:58 +02:00
Paolo Tranquilli
3f2a059b3b Swift: add location support to TSP diagnostics
This required a bit of an overhaul of the original integration of
JSON diagnostics into binlog.

The problem is that it is quite hard to add a kind of metadata to
binlog entries without changing its code. Another problem is that when
wanting to avoid double evaluation of logging macro arguments one
cannot really add a separate "diagnose" step easily.

The proposed solution consists in two things:
* hook into a binlog plumbing function by providing a better overload
  resolution match, which happens after logging macro expansion,
  bypassing the problem of double evaluation
* in that hook, produce the diagnostic directly, without waiting to
  reconstruct the diagnostics entry from the binlog serialized entry.

This allows to forgo the weird category to diagnostic mapping, and now a
diagnostics emission simply happens when a diagnostic source is given
as the first argument after the log format string. A flavour of
diganostics sources with locations is then added with the same
mechanism, allowing to write something like
```cpp
LOG_ERROR("[{}] ouch!", internalError.withLocation("foo.swift", 32));
```
2023-05-11 17:52:02 +02:00
Paolo Tranquilli
2904aa8439 Revert "Swift: auto-flush logs at exit"
This reverts commit 0d9dcb161f.

This turns out to introduce a subtle bug related to destruction order
between `Log::instance()` and the `Logger` instances.
2023-05-09 13:08:28 +02:00
Paolo Tranquilli
8f26c7e2d2 Swift: add one more help link to diagnostics 2023-05-09 10:52:26 +02:00
Paolo Tranquilli
08c43bc9b0 Swift: move diagnostics definition to the source file 2023-05-09 10:11:13 +02:00
Paolo Tranquilli
0d9dcb161f Swift: auto-flush logs at exit 2023-05-09 10:08:34 +02:00
Paolo Tranquilli
8079af7ed6 Swift: add autobuild failure diagnostics 2023-05-08 12:54:18 +00:00
Alex Denisov
ad9f5efcd7 Swift: stream directly instead of using intermediate string 2022-10-18 10:15:16 +02:00
Alex Denisov
6d754c42d7 Swift: do not use relative include paths 2022-10-18 09:14:48 +02:00
Alex Denisov
0521855755 Swift: split Xcode autobuild 2022-10-17 11:24:20 +02:00