- Update obioptions.Version from "Release 4.4.29" to "/v/ Release v5" - Update version.txt from 4.29 → .30 (automated by Makefile)
1.5 KiB
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 aroundlogrus.Warnf, enabling formatted warning messages. It respects a global "silent warnings" toggle defined inobidefault.SilentWarning().
Design Intent
-
Conditional Warning Output:
Warnings are suppressed whenobidefault.SilentWarning()returnstrue, supporting quiet or batch execution modes (e.g., CI pipelines, automated runs). -
Consistency & Integration:
Leveragesobidefaultto 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., addingDebugf,Infofwrappers).
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 backendobidefault: Configuration layer for global behavior (e.g., silence mode)
Note
: This package is not a full logging subsystem—it’s a targeted, policy-aware warning emitter.