Commit Graph

16 Commits

Author SHA1 Message Date
Paolo Tranquilli
33b6ce7365 Swift: update formatting to clang-format 17.0.6
Also, added a format check in `swift.yml`.
2024-01-25 13:58:14 +01:00
Calum Grant
d57fc3d7db C++: Remove unneeded includes 2024-01-17 14:34:28 +00:00
Calum Grant
f82c29ee37 Swift extractor: Generalize SwiftDiagnostics 2024-01-15 09:12:26 +00:00
Alexandre Boulgakov
838130ca3a Swift: Fix some C++20 todos. 2023-06-08 13:11:14 +01:00
Paolo Tranquilli
dbff3e4fa4 Swift: remove unneeded SwiftDiagnosticLogWrapper 2023-05-15 10:08:43 +02:00
Paolo Tranquilli
a2cb331ebe Swift: remove hacky binlog interception 2023-05-15 10:02:24 +02:00
Paolo Tranquilli
dedbd9ab63 Swift: remove unneeded SwiftDiagnosticsDumper 2023-05-12 08:30:43 +02:00
Paolo Tranquilli
86777fa4c2 Swift: remove obsolete comment 2023-05-12 08:23:14 +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
84c017083f Swift: add configuration of diagnostics logs 2023-05-09 14:42:43 +02:00
Paolo Tranquilli
ca94b20284 Swift: auto-flush logs on errors 2023-05-09 14:42:21 +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
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
Paolo Tranquilli
bce483ddb1 Swift: rename log package to logging 2023-05-04 10:42:39 +02:00