docs: log schema validation warnings through @apify/log - #10
Merged
metalwarrior665 merged 1 commit intoJul 27, 2026
Merged
Conversation
… instead of console.log
`@apify/log` is already a required peer dependency and is what the rest of the
package uses (see src/qc-logger), but this module still wrote to console.log,
so its output ignored the Actor's log level and format and couldn't be
silenced or shipped as JSON.
Every line now goes through `log.warning`. WARNING is the right level for all
of them: each one means a push was rejected and items were altered or lost,
which is never routine, and none of them is progress reporting.
The logger is a `log.child({ prefix: 'pushDataWithSchemaRepair' })`, so the
prefix each message used to spell out by hand is now applied at render time and
composes with whatever prefix the host Actor set. Rendered output is unchanged
apart from the level tag that @apify/log adds.
Tests capture `Log.prototype.warning` rather than console.log, and a new test
lets the real logger render so the prefix and the WARNING output channel are
covered too — intercepting `Log.warning` alone would still pass if either were
wrong.
Also adds CHANGELOG.md to .prettierignore. The release workflow regenerates it
without a trailing newline, which fails `format:check` and blocks the
pre-commit hook after every release; ignoring a generated file fixes that for
good instead of until the next release.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGk7vrUxB7dAt64mLKyH7J
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrated logging in
pushDataWithSchemaRepairfrom directconsole.logcalls to the@apify/loglibrary, routing all messages through a child logger at WARNING level with thepushDataWithSchemaRepairprefix.Key Changes
console.logcalls withlog.warning()using a child logger from@apify/logwith thepushDataWithSchemaRepairprefixpushDataWithSchemaRepair:prefix from message strings, as it's now added by the logger itselfcaptureLogs()helper to spy onLog.prototype.warninginstead ofconsole.log, and updated all test assertions to expect messages without the prefixImplementation Details
const log = baseLog.child({ prefix: 'pushDataWithSchemaRepair' })console.warnfor WARNING level) and include the prefix in the rendered outputhttps://claude.ai/code/session_01WGk7vrUxB7dAt64mLKyH7J