Skip to content

logger.severe: forward wrap argument to logger.message - #4287

Draft
madhavzanwar wants to merge 1 commit into
PecanProject:developfrom
madhavzanwar:GH-4286-logger-severe-ignores-wrap
Draft

madhavzanwar wants to merge 1 commit into
PecanProject:developfrom
madhavzanwar:GH-4286-logger-severe-ignores-wrap

Conversation

@madhavzanwar

Copy link
Copy Markdown
Contributor

Description

PEcAn.logger::logger.severe() declares wrap = TRUE (inheriting @inheritParams logger.message) and is called with wrap = FALSE across PEcAn when printing pre-formatted multi-line tables or error details (check_model_run.R, check_missing_files.R, query_pfts.R, get.trait.data.pft.R, query.prior.R, read.output.R). Because wrap is matched as a formal parameter of logger.severe(), passing wrap = FALSE kept it out of ..., and logger.severe() called logger.message("SEVERE", msg, ...) without forwarding wrap = wrap.

This PR forwards wrap = wrap to logger.message(), adds a regression test in base/logger/tests/testthat/test.logger.R verifying both wrap = FALSE (preserves newlines/spacing without leaking FALSE into stop()) and default wrap = TRUE (fails on develop, passes with fix), and updates base/logger/NEWS.md and CHANGELOG.md.

Motivation and Context

Fixes #4286

Review Time Estimate

  • Immediately
  • Within one week
  • When possible

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • My name is in the list of CITATION.cff
  • I agree that PEcAn Project may distribute my contribution under any or all of
    • the same license as the existing code,
    • and/or the BSD 3-clause license.
  • I have updated the CHANGELOG.md.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

logger.severe() ignores its wrap argument

1 participant