If the assertion handler is not tagged, a lot of false positives are
generated by clang static analyzer.
> The Clang-specific 'analyzer_noreturn' attribute is almost identical
> to 'noreturn' except that it is ignored by the compiler for the
> purposes of code generation.
>
> This attribute is useful for annotating assertion handlers that
> actually can return, but for the purpose of using the analyzer we
> want to pretend that such functions do not return.
https://clang-analyzer.llvm.org/annotations.html#custom_assertions
This commit mostly duplicates the wlr_log functions, although
with a sway_* prefix. (This is very similar to PR #2009.)
However, the logging function no longer needs to be replaceable,
so sway_log_init's second argument is used to set the exit
callback for sway_abort.
wlr_log_init is still invoked in sway/main.c
This commit makes it easier to remove the wlroots dependency for
the helper programs swaymsg, swaybg, swaybar, and swaynag.
_sway_assert is a variadic function which tries
to delegate to another variadic function. This
requires a vprintf-style variant of the delegate.
https://stackoverflow.com/a/150616
Replicates i3 option. Verbosity level given as command line argument
becomes default log level, and using 'debuglog toggle' switches back and
forth between default and debug (or L_ERROR and debug if default is also
L_DEBUG).