1 pointby Ridrik3 hours ago1 comment
  • Ridrik3 hours ago
    Hello! I've been developing a lightweight tool to detect, alert, and log whenever a fatal condition has occurred. I'm sharing it here today in case it's useful for your own projects.

    I started this as a utility for my own project because I wanted both visibility and traceability on all common software faults, without the need to inject or know about complex dependencies.

    fault is a Linux and Windows library for C and C++ users, implemented in C++20. Key features:

    - Broad coverage Handles POSIX signals, Windows SEH exceptions, std::terminate's, as well as having explicit panic and panic-based assertions, - Signal-safe by default: Prioritizes logging unresolved, safe traces within POSIX signal handlers. Safe trace cannot be written? If the user permits, fault will perform a best-effort attempt to do a regular trace while imposing safeguards against deadlocks and recursive signals., - Concurrency Resilient: If multiple threads trigger a fatal condition simultaneously, fault ensures only the first one enters the mechanism. It prevents the system from shutting down prematurely during the microseconds needed to log and display the report or popup., - Panic and Modern C++ assertions, backed with fault unified handling. Includes FAULT_ASSERT, fault::panic, fault::expect, with support for customizable strings, formatted arguments, and deferred callables. Whether debug only or also release, and whether you'll want source location or not, there's an equivalent expression present., - Cpptrace integration: Whereas hidden by default, if you use cpptrace, fault can automatically log propagated traces from exceptions and saved requested traces whenever a panic or std::terminate trigger.,

    Link to repo: https://github.com/Ridrik/fault

    fault is a work in progress, and new features may happen in the coming weeks. Feel free to try it out for yourself. Feedback appreciated.