Files
obitools4/autodoc/docmd/pkg/obilog/warning.md
T
Eric Coissac 8c7017a99d ⬆️ version bump to v4.5
- Update obioptions.Version from "Release 4.4.29" to "/v/ Release v5"
- Update version.txt from 4.29 → .30
(automated by Makefile)
2026-04-13 13:34:53 +02:00

31 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# `obilog` Package — Semantic Overview
The `obilog` package provides a lightweight, conditional logging interface for the OBItools4 ecosystem. It wraps `logrus`, a structured logger, to emit warnings only when explicitly allowed by application-wide settings.
## Core Functionality
- **`Warnf(format string, args ...interface{})`**
A convenience wrapper around `logrus.Warnf`, enabling formatted warning messages. It respects a global "silent warnings" toggle defined in `obidefault.SilentWarning()`.
## Design Intent
- **Conditional Warning Output**:
Warnings are suppressed when `obidefault.SilentWarning()` returns `true`, supporting quiet or batch execution modes (e.g., CI pipelines, automated runs).
- **Consistency & Integration**:
Leverages `obidefault` to enforce centralized control over verbosity, aligning logging behavior with higher-level application configuration.
- **Minimal Abstraction**:
Keeps the interface simple and idiomatic, avoiding over-engineering while preserving flexibility for future extensions (e.g., adding `Debugf`, `Infof` wrappers).
## Use Case
Ideal for non-fatal issues in command-line tools or libraries—where warnings should be visible by default but suppressible on demand, without altering core logic.
## Dependencies
- `logrus`: Structured logging backend
- `obidefault`: Configuration layer for global behavior (e.g., silence mode)
> **Note**: This package is *not* a full logging subsystem—its a targeted, policy-aware warning emitter.