Repository navigation
Conversation
|
@snafudev did you switch away from using @Snafulator ? Did I invite the wrong github account? |
Didn't realise i had a second github account. That's embarassing lol. |
88d1dea to
69915f6
Compare
|
Added one more comment about the channel bitmap, but imo otherwise this is good. Just make sure the CI passes. |
Managed to recover my old account :) |
6618420 to
acc4ba7
Compare
- introduce channel bitmasks for AI state, AI decision, and REC logging - add CLI support for selecting enabled channels via --log-channels + document log channel usage in README - apply ai-state/ai-decisions channels to debug logging in ai_controller + remove unused debug logs (will be replaced in pilot-ai-v2) - add test coverage for the logging module behavior and channel parsing
- restore printf-style attributes on log declarations - add placeholder channels for network, gameplay, graphics, and sound - update README and CLI docs to describe comma-separated channel filtering - remove composite ai alias in favor of explicit per-channel selection - clarify channel tagging vs. filter behavior in logging implementation
- Rename log_*_c to log_*_channel (to avoid confusion with C-string suffix conventions) - Rename log_module_test to log_tests - Rename graphics/sound log channels to video/audio (to match the directories)
acc4ba7 to
b8b71ab
Compare
I don't use my non-work github accounts often, so i lost track of which one i was using for this project. Will return to using Snafulator going forward. |
7c7475d to
47bf13a
Compare
47bf13a to
30daebb
Compare
| } | ||
| // Untagged DEBUG messages stay quiet; untagged INFO/WARN/ERROR remain visible. | ||
| // When filtering, emit tagged messages only for the enabled channels. | ||
| if(module == LOG_CHANNEL_NONE) { |
There was a problem hiding this comment.
This is a bit odd quirk, but I guess it is fine for now. Better solution though would be to allow more complex logging configs, e.g. via a config file ;)
There was a problem hiding this comment.
If possible, it would be nice to not do magic like this -- it will bite someone in the ass sooner or later.
| @@ -120,12 +120,95 @@ const char *path_c(const path *path) { | |||
| #endif | |||
|
|
|||
| bool path_resolve(path *p) { | |||
| } | ||
|
|
||
| static void log_vmsg_channel(log_channel module, log_level level, const char *fmt, va_list args) | ||
| ATTR_FORMAT_PRINTF(3, 0); |
There was a problem hiding this comment.
What's the purpose of this declaration? isn't the function defined right after here?
| @@ -206,6 +201,9 @@ static void format_timestamp(char *buffer, size_t len) { | |||
| buffer[len - 1] = 0; | |||
There was a problem hiding this comment.
better use '\0' for for terminal character, since that's the convention for strings.
Description:
Adds the ability to define a channel when calling log_debug / log_error etc.
You can then run the binary with '--log-channels' flag to only show log messages from the specified channels.
This will come in useful in the ai controller rework as we need the ability to either manually run a demo or record a demo while filtering out all the other noise unrelated to ai state/decision flow.
Changes: