2015-08-09 07:01:22 +10:00
|
|
|
#ifndef _SWAY_LOG_H
|
|
|
|
#define _SWAY_LOG_H
|
2015-08-19 07:38:34 +10:00
|
|
|
#include <stdbool.h>
|
2018-01-06 08:32:51 +11:00
|
|
|
#include <wlr/util/log.h>
|
2017-04-21 02:13:53 +10:00
|
|
|
|
2018-01-06 09:36:32 +11:00
|
|
|
void _sway_abort(const char *filename, ...) ATTRIB_PRINTF(1, 2);
|
2017-04-21 02:13:53 +10:00
|
|
|
#define sway_abort(FMT, ...) \
|
2018-02-25 04:49:42 +11:00
|
|
|
_sway_abort("[%s:%d] " FMT, wlr_strip_path(__FILE__), __LINE__, ##__VA_ARGS__)
|
2015-08-27 04:01:26 +10:00
|
|
|
|
2018-01-06 09:36:32 +11:00
|
|
|
bool _sway_assert(bool condition, const char* format, ...) ATTRIB_PRINTF(2, 3);
|
2015-08-27 04:01:26 +10:00
|
|
|
#define sway_assert(COND, FMT, ...) \
|
2018-02-25 04:49:42 +11:00
|
|
|
_sway_assert(COND, "[%s:%d] %s:" FMT, wlr_strip_path(__FILE__), __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__)
|
2015-08-27 04:01:26 +10:00
|
|
|
|
2015-08-25 06:44:58 +10:00
|
|
|
void error_handler(int sig);
|
2015-08-09 07:01:22 +10:00
|
|
|
|
|
|
|
#endif
|