Skip to content

log: tag log.fatal with @[noreturn] - #22986

Merged
medvednikov merged 4 commits into
vlang:masterfrom
Le0Developer:fix/log-fatal-noreturn
Nov 27, 2024
Merged

medvednikov merged 4 commits into
vlang:masterfrom
Le0Developer:fix/log-fatal-noreturn

Conversation

@Le0Developer

@Le0Developer Le0Developer commented Nov 27, 2024 •

Copy link
Copy Markdown
Member

fixes #22985

Copilot summary:

This pull request includes changes to the logging functionality in the vlib/log module. The most important changes include adding the @[noreturn] attribute to the fatal function and introducing new test cases to ensure the correct behavior of the logging functions.

Improvements to logging functionality:

  • vlib/log/default.v: Added the @[noreturn] attribute to the fatal function to indicate that it will not return, and ensured the function exits the program with exit(1) after logging a fatal message.

Enhancements to test cases:

  • vlib/log/log_test.v: Added a new function make_error and a test case test_log_default_fatal_has_noreturn to verify that the fatal function behaves as expected and does not return.

Huly®: V_0.6-21427

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work.

@spytheman spytheman changed the title fix: add @[noreturn] to log.fatal log: tag log.fatal with @[noreturn] Nov 27, 2024
@medvednikov
medvednikov merged commit aeaf607 into vlang:master Nov 27, 2024
@Le0Developer
Le0Developer deleted the fix/log-fatal-noreturn branch November 27, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

module level log.fatal is not marked as @[noreturn]

4 participants