Skip to content

Several misc logging fixes - #280

Merged
embray merged 8 commits into
asdf-format:mainfrom
embray:logging-fixes
Oct 16, 2026
Merged

embray merged 8 commits into
asdf-format:mainfrom
embray:logging-fixes

Conversation

@embray

@embray embray commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Description

See the changelog fragment for details. Fixed several bugs in the logging surfaced while trying to integrate it into SourceXtractor++ (#24). These are useful fixes even without #279 (to be added later) which is the full solution.

AI Disclosure

No AI tools used.

When debug logging is enabled these messages produce the vast majority
of noise, for practically every value read from the YAML.  I don't have
a well-articulated policy for when to use TRACE vs DEBUG, but I feel
that DEBUG should still be informative to users while TRACE is strictly
for the lowest-level info mostly for debugging the library, as opposed
to debugging *uses* of the library, if that makes sense...
especially important if the underlying stream is buffered, so that log
messages don't get lost, or come out clumped together.
Add several new tests for the logging system, especially some regression
tests for bugs that need to be fixed (errno saving, tty color handling,
malformatting of messages when certain fields are disabled).

Several existing tests that tested for specific log messages each used
some different mechanisms for capturing the log.  This standardizes that
as well into a single log capture utility (though hopefully this will be
less needed once asdf-formatgh-279 is implemented).
@embray embray added the bug Something isn't working label Oct 14, 2026
Trying to integrate libasdf's logging mechanism into a separate
application like SourceXtractor++ (see asdf-formatgh-24) surfaced a number of small
bugs and necessary enhancements.  What it really wants is a new
structured logging interface as explained in asdf-formatgh-279.  However, with or
without that these bugs are all relevant, even just for libasdf itself.

The details are listed in the changelog fragment.
Depending on the build path location it would generate relative paths
from the build directory to the top_srcdir, resulting in noisy diffs if
re-running from different build directories.
…LOG_COLOR

SE++ needs uncolored logs so it can parse them easily and feed them into
its own logger without having to wade through ANSI escapes, and we
shouldn't let the user override that via a stray environment variable
either.  An application setting no_color has a stronger claim here.

Instead the ASDF_LOG_COLOR env var just overrides the isatty detection
for the default behavior.

Will be less relevant once asdf-formatgh-279 is done though.
List items following normal paragraphs *without* a blank line where just
merged into that paragraph and incorrectly wrapped, rather than being
treated as its own paragraph-like block in the first place.

Ideally this would work better if it used the docutils rst outputter,
but that would require an extra dependency I don't want to deal with
right now.
@embray
embray merged commit a76a152 into asdf-format:main Oct 16, 2026
12 checks passed
@embray
embray deleted the logging-fixes branch October 16, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant