wasi-logging icon indicating copy to clipboard operation
wasi-logging copied to clipboard

Add notice level

Open psztoch opened this issue 9 months ago • 2 comments

Why notice and critical are needed:

🔶 notice Definition: A level between info and warn. Use case: Meant for important but non-problematic events. Examples: System configuration changes. An admin user logs in. An event that should be visible to operators but is not a warning or error. Why info is not enough: info can be noisy—it may include routine operational logs (e.g., thread started, cache warmed up). notice highlights messages that are not errors, but still require attention.

🔴 critical Definition: A level above error, indicating: Threats to system stability. Events requiring immediate action. Catastrophic failures (e.g., data loss, system corruption). Why error is not enough: In many applications, error is used liberally (e.g., failed login attempt, network timeout). critical distinguishes events that are truly urgent and severe: Critical database corruption. Out-of-memory errors. Service crashing or halting.

psztoch avatar Jun 20 '25 10:06 psztoch

wasi-logging here is designed from an application perspective, rather than a "system" perspective. Applications don't always know their place in the larger system, and don't inherently know if the data they're processing is considered "critical" within the context of the full system. They won't always have a way of determining whether some condition "requires attention" from an operator.

If someone is designing an operating system or orchestration system that will have concepts of admin users, logins, operators, services, and so on, I expect they'll wish to define their own log levels, perhaps using something like the levels defined by POSIX syslog which does include "critical" and "notice" levels, and more. However, a system like that wouldn't require WASI applications to use those levels.

In such a system, applications could log errors with the error level, and then the code that invokes those applications, which does know the system context, might map those error logs to POSIX LOG_CRIT or LOG_ERR accordingly.

sunfishcode avatar Jul 07 '25 23:07 sunfishcode

Also, the interface already does include critical.

sunfishcode avatar Jul 08 '25 00:07 sunfishcode