2023-09-07 12:51:48 +00:00
|
|
|
/*************************************************************************
|
2023-08-09 11:06:32 +00:00
|
|
|
*
|
2023-09-07 12:51:48 +00:00
|
|
|
* Orca
|
|
|
|
* Copyright 2023 Martin Fouilleul and the Orca project contributors
|
|
|
|
* See LICENSE.txt for licensing information
|
2023-08-09 11:06:32 +00:00
|
|
|
*
|
2023-09-07 12:51:48 +00:00
|
|
|
**************************************************************************/
|
2023-08-09 11:06:32 +00:00
|
|
|
#ifndef __PLATFORM_DEBUG_H_
|
|
|
|
#define __PLATFORM_DEBUG_H_
|
|
|
|
|
2023-08-19 12:49:23 +00:00
|
|
|
#include "platform.h"
|
2023-08-09 11:06:32 +00:00
|
|
|
|
|
|
|
//----------------------------------------------------------------
|
|
|
|
// Assert / Abort
|
|
|
|
//----------------------------------------------------------------
|
|
|
|
|
2023-08-14 08:26:11 +00:00
|
|
|
ORCA_API _Noreturn void oc_abort_ext(const char* file, const char* function, int line, const char* fmt, ...);
|
|
|
|
ORCA_API _Noreturn void oc_assert_fail(const char* file, const char* function, int line, const char* src, const char* fmt, ...);
|
2023-08-09 11:06:32 +00:00
|
|
|
|
|
|
|
//----------------------------------------------------------------
|
|
|
|
// Logging
|
|
|
|
//----------------------------------------------------------------
|
|
|
|
|
2023-08-19 12:49:23 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
OC_LOG_LEVEL_ERROR,
|
|
|
|
OC_LOG_LEVEL_WARNING,
|
|
|
|
OC_LOG_LEVEL_INFO,
|
|
|
|
OC_LOG_LEVEL_COUNT
|
|
|
|
} oc_log_level;
|
2023-08-09 11:06:32 +00:00
|
|
|
|
2023-08-14 08:26:11 +00:00
|
|
|
typedef struct oc_log_output oc_log_output;
|
2023-08-09 11:06:32 +00:00
|
|
|
|
2023-08-14 08:26:11 +00:00
|
|
|
extern oc_log_output* OC_LOG_DEFAULT_OUTPUT;
|
2023-08-09 11:06:32 +00:00
|
|
|
|
2023-08-14 08:26:11 +00:00
|
|
|
ORCA_API void oc_log_set_level(oc_log_level level);
|
|
|
|
ORCA_API void oc_log_set_output(oc_log_output* output);
|
|
|
|
ORCA_API void oc_log_ext(oc_log_level level,
|
2023-08-19 12:49:23 +00:00
|
|
|
const char* function,
|
|
|
|
const char* file,
|
|
|
|
int line,
|
|
|
|
const char* fmt,
|
|
|
|
...);
|
2023-08-09 11:06:32 +00:00
|
|
|
|
|
|
|
#endif //__PLATFORM_DEBUG_H_
|