diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-22 23:53:24 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-22 23:53:24 +0100 |
| commit | 3c62d3d54244731b641952bd7e93edbab16d5d79 (patch) | |
| tree | 60f1682e916b93b856a6b24b78e28064832156cf /examples/logging.c | |
| parent | ef522ea5cd0c1f25fe8f3c66e23ef7f61a3017fd (diff) | |
| download | nonstd-3c62d3d54244731b641952bd7e93edbab16d5d79.tar.gz | |
Add PPM simple image implementation
Diffstat (limited to 'examples/logging.c')
| -rw-r--r-- | examples/logging.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/examples/logging.c b/examples/logging.c index 1d2744c..8e87d59 100644 --- a/examples/logging.c +++ b/examples/logging.c @@ -2,24 +2,24 @@ #include "../nonstd.h" int main(void) { - // Default level is LOG_INFO - LOG_INFO_MSG("This is an info message: %d", 42); - LOG_DEBUG_MSG("This debug message will NOT be shown by default"); + // Default level is LOG_INFO + LOG_INFO_MSG("This is an info message: %d", 42); + LOG_DEBUG_MSG("This debug message will NOT be shown by default"); - // Change level to LOG_DEBUG - set_log_level(LOG_DEBUG); - LOG_DEBUG_MSG("Now debug messages are shown: %s", "hello"); + // Change level to LOG_DEBUG + set_log_level(LOG_DEBUG); + LOG_DEBUG_MSG("Now debug messages are shown: %s", "hello"); - // Warnings and Errors - LOG_WARN_MSG("This is a warning!"); - LOG_ERROR_MSG("This is an error!"); + // Warnings and Errors + LOG_WARN_MSG("This is a warning!"); + LOG_ERROR_MSG("This is an error!"); - // Environment variable override test - // You can set LOG_LEVEL=1 (WARN) etc. - LogLevel env_level = get_log_level_from_env(); - if (env_level != LOG_DEBUG) { - printf("Environment overrides level to: %d\n", env_level); - } + // Environment variable override test + // You can set LOG_LEVEL=1 (WARN) etc. + LogLevel env_level = get_log_level_from_env(); + if (env_level != LOG_DEBUG) { + printf("Environment overrides level to: %d\n", env_level); + } - return 0; + return 0; } |
