2023-08-09 11:06:32 +00:00
|
|
|
/************************************************************//**
|
|
|
|
*
|
|
|
|
* @file: platform_debug.h
|
|
|
|
* @author: Martin Fouilleul
|
|
|
|
* @date: 13/08/2023
|
|
|
|
*
|
|
|
|
*****************************************************************/
|
|
|
|
#ifndef __PLATFORM_DEBUG_H_
|
|
|
|
#define __PLATFORM_DEBUG_H_
|
|
|
|
|
|
|
|
#include"platform.h"
|
|
|
|
|
|
|
|
//----------------------------------------------------------------
|
|
|
|
// 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-14 08:26:11 +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,
|
|
|
|
const char* function,
|
|
|
|
const char* file,
|
|
|
|
int line,
|
|
|
|
const char* fmt,
|
|
|
|
...);
|
2023-08-09 11:06:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
#endif //__PLATFORM_DEBUG_H_
|