[Improvement] NOB_NO_ECHO
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- c
- Domain
- build-system
Research direction
Start in nob.h by locating the NOB_NO_ECHO handling and the Nob_Log_Level enum shown in the issue. Check how log levels are compared and dispatched, then verify that the proposed enum option provides the same no-echo behavior without the separate NOB_NO_ECHO special case.
Written by the indexing model from the issue text.
Description
I like that there's a way to remove the echo from nob.h but shouldn't it just be one of the options in Nob_Log_Level?
That way there would be no need to special case it by using NOB_NO_ECHO.
typedef enum {
NOB_ECHO = -1,
NOB_INFO,
NOB_WARNING,
NOB_ERROR,
NOB_NO_LOGS,
} Nob_Log_Level;
// ...
NOBDEF void nob_log(Nob_Log_Level level, const char *fmt, ...)
{
if (level < nob_minimal_log_level) return;
switch (level) {
case NOB_ECHO:
case NOB_INFO:
fprintf(stderr, "[INFO] ");
break;
case NOB_WARNING:
fprintf(stderr, "[WARNING] ");
break;
case NOB_ERROR:
fprintf(stderr, "[ERROR] ");
break;
case NOB_NO_LOGS: return;
default:
NOB_UNREACHABLE("nob_log");
}
// ...
- Dominant language
- C++
- Stars
- 3.3k
- Forks
- 214
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tsoding/nob.h
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
nob__walk_dir_opt_impl() tries to close zeroed handle for non directory entriesPossibly taken @whophi claimed this 60 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
nob_get_file_type error check is dead code: nob_copy_directory_recursively aborts and nob_walk_dir returns true on unreadable pathsPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 76/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
MerginMaps/mobile#4741 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Icinga/icinga2#11077 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
agent:WSL bug linux LOW ui
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Copter: PosHold brake-entry threshold became 16 deg instead of 0.16 deg after the radians conversionPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 78/100
ArduPilot/ardupilot#34617 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day