Skip to content

Commit 8d4afc5

Browse files
authored
Merge pull request #2405 from elBoberido/iox-1755-make-log-enum-tags-upper-camel-case
iox-#1755 Use upper camel case for LogLevel enum tags
2 parents f6e2a98 + 4fb2c8d commit 8d4afc5

File tree

180 files changed

+1074
-1087
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+1074
-1087
lines changed

.cirrus.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ iox_run_tests_template: &IOX_RUN_TESTS
103103

104104
preflight_check_task:
105105
container:
106-
dockerfile: tools/ci/docker/ubuntu-22.04
106+
dockerfile: tools/ci/docker/ubuntu-24.04
107107
cpu: 1
108108
memory: 4GB
109109
<<: *IOX_TASK_TIMEOUT
@@ -114,13 +114,13 @@ preflight_check_task:
114114
cmake_linter_script: tools/ci/cmake-linter.sh
115115

116116
#
117-
# Ubuntu 22.04 aarch64
117+
# Ubuntu 24.04 aarch64
118118
#
119119

120120
ubuntu_22_04_aarch64_build_task:
121121
depends_on: preflight_check
122122
arm_container:
123-
dockerfile: tools/ci/docker/ubuntu-22.04
123+
dockerfile: tools/ci/docker/ubuntu-24.04
124124
<<: *IOX_COMMON_CPU_AND_MEMORY_CONFIG_FOR_BUILDS
125125
<<: *IOX_TASK_TIMEOUT
126126
test_binaries_cache:
@@ -135,7 +135,7 @@ ubuntu_22_04_aarch64_build_task:
135135
ubuntu_22_04_aarch64_test_task:
136136
depends_on: ubuntu_22_04_aarch64_build
137137
arm_container:
138-
dockerfile: tools/ci/docker/ubuntu-22.04
138+
dockerfile: tools/ci/docker/ubuntu-24.04
139139
<<: *IOX_COMMON_CPU_AND_MEMORY_CONFIG_FOR_TESTS
140140
<<: *IOX_TASK_TIMEOUT
141141
test_binaries_cache:

.github/actions/install-iceoryx-deps-and-clang/action.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ runs:
77
run: |
88
sudo dpkg --add-architecture i386
99
sudo wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
10-
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-15 main"
10+
sudo add-apt-repository "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-18 main"
1111
sudo apt-get update
1212
sudo apt-get install -y libacl1-dev libncurses5-dev
1313
sudo apt-get install -y libacl1-dev:i386 libc6-dev-i386 libc6-dev-i386-cross libstdc++6-i386-cross gcc-multilib g++-multilib
14-
sudo apt-get install -y clang-format-15 clang-tidy-15 clang-tools-15 clang-15 lld
14+
sudo apt-get install -y clang-format-18 clang-tidy-18 clang-tools-18 clang-18 lld
1515
sudo rm /usr/bin/clang
1616
sudo rm /usr/bin/clang++
1717
sudo rm /usr/bin/clang-tidy
1818
sudo rm /usr/bin/clang-format
19-
sudo ln -s /usr/bin/clang-15 /usr/bin/clang
20-
sudo ln -s /usr/bin/clang++-15 /usr/bin/clang++
21-
sudo ln -s /usr/bin/clang-tidy-15 /usr/bin/clang-tidy
22-
sudo ln -s /usr/bin/clang-format-15 /usr/bin/clang-format
19+
sudo ln -s /usr/bin/clang-18 /usr/bin/clang
20+
sudo ln -s /usr/bin/clang++-18 /usr/bin/clang++
21+
sudo ln -s /usr/bin/clang-tidy-18 /usr/bin/clang-tidy
22+
sudo ln -s /usr/bin/clang-format-18 /usr/bin/clang-format

.github/workflows/build-test.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
pre-flight-check:
1414
# prevent stuck jobs consuming runners for 6 hours
1515
timeout-minutes: 60
16-
runs-on: ubuntu-latest
16+
runs-on: ubuntu-24.04
1717
steps:
1818
- uses: actions/checkout@v4
1919
- name: Install iceoryx dependencies and clang-tidy
@@ -25,7 +25,7 @@ jobs:
2525
- run: ./tools/ci/cmake-linter.sh
2626

2727
check-status-of-nightly-action:
28-
runs-on: ubuntu-latest
28+
runs-on: ubuntu-24.04
2929
needs: pre-flight-check
3030
steps:
3131
- name: Install dependencies
@@ -102,7 +102,7 @@ jobs:
102102
# prevent stuck jobs consuming runners for 6 hours
103103
timeout-minutes: 60
104104
needs: pre-flight-check
105-
runs-on: ubuntu-latest
105+
runs-on: ubuntu-24.04
106106
steps:
107107
- uses: actions/checkout@v4
108108
- name: Unix (FreeBSD) test
@@ -132,7 +132,7 @@ jobs:
132132
build-test-ubuntu-with-address-sanitizer-gcc-latest:
133133
# prevent stuck jobs consuming runners for 1 hour
134134
timeout-minutes: 60
135-
runs-on: ubuntu-latest
135+
runs-on: ubuntu-24.04
136136
needs: pre-flight-check
137137
steps:
138138
- uses: egor-tensin/[email protected]
@@ -146,7 +146,7 @@ jobs:
146146
build-test-ubuntu-with-address-sanitizer-clang-latest:
147147
# prevent stuck jobs consuming runners for 1 hour
148148
timeout-minutes: 60
149-
runs-on: ubuntu-latest
149+
runs-on: ubuntu-24.04
150150
needs: pre-flight-check
151151
steps:
152152
- name: Checkout
@@ -169,7 +169,7 @@ jobs:
169169
build-test-ubuntu-with-thread-sanitizer-clang-latest:
170170
# prevent stuck jobs consuming runners for 3 hours
171171
timeout-minutes: 180
172-
runs-on: ubuntu-latest
172+
runs-on: ubuntu-24.04
173173
needs: pre-flight-check
174174
steps:
175175
- name: Checkout
@@ -182,7 +182,7 @@ jobs:
182182
build-test-ubuntu-32-bit:
183183
# prevent stuck jobs consuming runners for 6 hours
184184
timeout-minutes: 60
185-
runs-on: ubuntu-latest
185+
runs-on: ubuntu-24.04
186186
needs: pre-flight-check
187187
steps:
188188
- name: Checkout
@@ -204,7 +204,7 @@ jobs:
204204
build-test-ubuntu-32-64-bit-mix-mode:
205205
# prevent stuck jobs consuming runners for 6 hours
206206
timeout-minutes: 60
207-
runs-on: ubuntu-latest
207+
runs-on: ubuntu-24.04
208208
needs: pre-flight-check
209209
steps:
210210
- name: Checkout
@@ -217,7 +217,7 @@ jobs:
217217
build-test-ubuntu-bazel:
218218
# prevent stuck jobs consuming runners for 6 hours
219219
timeout-minutes: 60
220-
runs-on: ubuntu-latest
220+
runs-on: ubuntu-24.04
221221
needs: pre-flight-check
222222
steps:
223223
- name: Checkout

.github/workflows/lint_pull_request.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
clang-tidy-review:
9-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-24.04
1010

1111
steps:
1212
- name: Checkout
@@ -24,7 +24,7 @@ jobs:
2424
run: ./tools/scripts/clang_tidy_check.sh scan_list .clang-tidy-diff-scans.txt "${{ steps.changed_files.outputs.added_modified }}"
2525

2626
check-for-todo:
27-
runs-on: ubuntu-latest
27+
runs-on: ubuntu-24.04
2828

2929
steps:
3030
- name: Checkout
@@ -36,7 +36,7 @@ jobs:
3636
run: ./tools/ci/todo-verificator.sh
3737

3838
verify-links-in-markdown-documentation:
39-
runs-on: ubuntu-latest
39+
runs-on: ubuntu-24.04
4040
steps:
4141
- uses: actions/checkout@v4
4242

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- run: ./tools/ci/build-test-macos.sh
1616

1717
clang-tidy-full-scan:
18-
runs-on: ubuntu-latest
18+
runs-on: ubuntu-24.04
1919

2020
steps:
2121
- name: Checkout

doc/design/diagrams/logging/logging_classes.puml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
package building_blocks <<Frame>> {
44

55
enum LogLevel {
6-
OFF = 0,
7-
FATAL,
8-
ERROR,
9-
WARN,
10-
INFO,
11-
DEBUG,
12-
TRACE,
6+
Off = 0,
7+
Fatal,
8+
Error,
9+
Warn,
10+
Info,
11+
Debug,
12+
Trace,
1313
}
1414

1515
class Logger <BaseLogger> {

doc/design/logging.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ variables, e.g. the log level.
2323

2424
| LogLevel | Usage |
2525
|----------|-------|
26-
| FATAL | For fatal and non-recoverable errors which essentially lead to termination of the program. |
27-
| ERROR | For severe but recoverable errors. |
28-
| WARN | For cases when something unintentional happens which is not considered a severe error. |
29-
| INFO | Anything which could be relevant for the daily user. |
30-
| DEBUG | Anything that is helpful for debugging, i.e. the info log level for the fellow developer. |
31-
| TRACE | Anything that might be helpful for debugging in some cases but would be too verbose for debug log level. |
32-
33-
The log levels `FATAL`, `ERROR` and `WARN` should not be used independently but
26+
| Fatal | For fatal and non-recoverable errors which essentially lead to termination of the program. |
27+
| Error | For severe but recoverable errors. |
28+
| Warn | For cases when something unintentional happens which is not considered a severe error. |
29+
| Info | Anything which could be relevant for the daily user. |
30+
| Debug | Anything that is helpful for debugging, i.e. the info log level for the fellow developer. |
31+
| Trace | Anything that might be helpful for debugging in some cases but would be too verbose for debug log level. |
32+
33+
The log levels `Fatal`, `Error` and `Warn` should not be used independently but
3434
in combination with the error handler and vice versa.
3535

3636
## Design
@@ -146,14 +146,14 @@ logger, independent of the active log level.
146146

147147
The `IOX_LOG_INTERNAL` calls `self()` on the `LogStream` instance to create an lvalue
148148
reference to the `LogStream` instance. This eases the implementation of logging
149-
support for custom types since `IOX_LOG(INFO, myType);` would require to implement
150-
an overload with a rvalue `LogStream` reference but `IOX_LOG(INFO, "#### " << myType);`
149+
support for custom types since `IOX_LOG(Info, myType);` would require to implement
150+
an overload with a rvalue `LogStream` reference but `IOX_LOG(Info, "#### " << myType);`
151151
requires a lvalue reference.
152152

153153
#### Behavior before calling Logger::init
154154

155155
In order to have log messages before `Logger::init` is called, the default logger
156-
is used with `LogLevel::INFO`. It is up to the implementation of the default
156+
is used with `LogLevel::Info`. It is up to the implementation of the default
157157
logger what to do with these messages. For iceoryx the default logger is the
158158
`ConsoleLogger` (this can be changed via the platform abstraction) which will
159159
print the log messages to the console.
@@ -269,11 +269,11 @@ This is the sequence diagram of the setup of the testing logger:
269269
The behavior of the logger can be altered via environment variables and the
270270
`Logger::init` function. Calling this function without arguments, it will check
271271
whether the environment variable `IOX_LOG_LEVEL` is set and use that value or
272-
`LogLevel::INFO` if the environment variable is not set. To have a different
272+
`LogLevel::Info` if the environment variable is not set. To have a different
273273
fallback log level, the `logLevelFromEnvOr` function can be used, e.g.
274274
275275
```cpp
276-
iox::log::Logger::init(iox::log::logLevelFromEnvOr(iox::log::LogLevel::DEBUG));
276+
iox::log::Logger::init(iox::log::logLevelFromEnvOr(iox::log::LogLevel::Debug));
277277
```
278278

279279
If the logger shall not be altered via environment variables, `Logger::init` must
@@ -303,9 +303,9 @@ re-implemented via the platform abstraction.
303303

304304
int main()
305305
{
306-
iox::log::Logger::init(iox::log::logLevelFromEnvOr(iox::log::LogLevel::DEBUG));
306+
iox::log::Logger::init(iox::log::logLevelFromEnvOr(iox::log::LogLevel::Debug));
307307

308-
IOX_LOG(DEBUG, "Hello World");
308+
IOX_LOG(Debug, "Hello World");
309309

310310
return 0;
311311
}
@@ -333,7 +333,7 @@ iox::log::LogStream& operator<<(iox::log::LogStream& stream, const MyType& m)
333333
int main()
334334
{
335335
MyType m;
336-
IOX_LOG(INFO, m);
336+
IOX_LOG(Info, m);
337337

338338
return 0;
339339
}
@@ -355,7 +355,7 @@ class MyLogger : public iox::log::Logger
355355
{
356356
static MyLogger myLogger;
357357
iox::log::Logger::setActiveLogger(myLogger);
358-
iox::log::Logger::init(iox::log::logLevelFromEnvOr(iox::log::LogLevel::INFO));
358+
iox::log::Logger::init(iox::log::logLevelFromEnvOr(iox::log::LogLevel::Info));
359359
}
360360

361361
private:
@@ -366,22 +366,22 @@ class MyLogger : public iox::log::Logger
366366
iox::log::LogLevel logLevel) noexcept override
367367
{
368368
switch(logLevel) {
369-
case iox::log::LogLevel::FATAL:
369+
case iox::log::LogLevel::Fatal:
370370
logString("💀: ");
371371
break;
372-
case iox::log::LogLevel::ERROR:
372+
case iox::log::LogLevel::Error:
373373
logString("🙈: ");
374374
break;
375-
case iox::log::LogLevel::WARN:
375+
case iox::log::LogLevel::Warn:
376376
logString("🙀: ");
377377
break;
378-
case iox::log::LogLevel::INFO:
378+
case iox::log::LogLevel::Info:
379379
logString("💘: ");
380380
break;
381-
case iox::log::LogLevel::DEBUG:
381+
case iox::log::LogLevel::Debug:
382382
logString("🐞: ");
383383
break;
384-
case iox::log::LogLevel::TRACE:
384+
case iox::log::LogLevel::Trace:
385385
logString("🐾: ");
386386
break;
387387
default:
@@ -399,12 +399,12 @@ int main()
399399
{
400400
MyLogger::init();
401401

402-
IOX_LOG(FATAL, "Whoops ... look, over there is a dead seagull flying!");
403-
IOX_LOG(ERROR, "Oh no!");
404-
IOX_LOG(WARN, "It didn't happen!");
405-
IOX_LOG(INFO, "All glory to the hypnotoad!");
406-
IOX_LOG(DEBUG, "I didn't do it!");
407-
IOX_LOG(TRACE, "Row row row your boat!");
402+
IOX_LOG(Fatal, "Whoops ... look, over there is a dead seagull flying!");
403+
IOX_LOG(Error, "Oh no!");
404+
IOX_LOG(Warn, "It didn't happen!");
405+
IOX_LOG(Info, "All glory to the hypnotoad!");
406+
IOX_LOG(Debug, "I didn't do it!");
407+
IOX_LOG(Trace, "Row row row your boat!");
408408

409409
return 0;
410410
}
@@ -420,9 +420,9 @@ int main()
420420
log messages when the signal is raised? It might be necessary to wait for the
421421
error handling refactoring before this can be done
422422
- instead of having the `Logger::init()` static function with hidden default
423-
parameter this could be replaced by `Logger::init(LogLevel::WARN)`,
424-
`Logger::initFromEnvOr(LogLevel::WARN)` and a builder like
425-
`Logger::customize().logLevelFromEnvOr(LogLevel::WARN).init()`
423+
parameter this could be replaced by `Logger::init(LogLevel::Warn)`,
424+
`Logger::initFromEnvOr(LogLevel::Warn)` and a builder like
425+
`Logger::customize().logLevelFromEnvOr(LogLevel::Warn).init()`
426426
- wrap `__FILE__`, `__LINE__` and `__FUNCTION__` into a `source_location` struct
427427
- where should this struct be placed
428428
- could also be used by `IOX_EXPECTS`, `IOX_ENSURES`

0 commit comments

Comments
 (0)