log.h
Go to the documentation of this file.
1 // vim:set ft=c sw=2 sts=2 fenc=utf8:
2 
3 /*
4  * libasterix
5  * Copyright [2013-2020] SinoATC <http://www.sinoatc.com>.
6  * All Rights Reserved.
7  *
8  * NOTICE: All information contained herein is, and remains
9  * the property of SinoATC and its suppliers, if any.
10  * The intellectual and technical concepts contained herein
11  * are proprietary to Aerosys Corporation and its suppliers and may be
12  * covered by U.S. and Foreign Patents, patents in process,
13  * and are protected by trade secret or copyright law.
14  * Dissemination of this information or reproduction of this material
15  * is strictly forbidden unless prior written permission is obtained
16  * from SinoATC.
17  */
18 
25 #ifndef LIBASTERIX_LOG_H
26 #define LIBASTERIX_LOG_H
27 
28 #include "platform.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
35 typedef enum _ast_log_level_t
36 {
43 
45 #define AST_MAX_LOG_MESSAGE_SIZE 512
46 
49 typedef void (*ast_log_handler_func_t)(ast_log_level_t level, const char* message);
50 
54 
57 AST_API void ast_log_stdout(ast_log_level_t level, const char* message);
58 
59 #ifdef __cplusplus
60  }
61 #endif // extern "C"
62 
63 #endif //LIBASTERIX_LOG_H
void(* ast_log_handler_func_t)(ast_log_level_t level, const char *message)
Function prototype of log handler callback.
Definition: log.h:49
Error that will cause library crash.
Definition: log.h:41
Error that will cause cause decoding/encoding fail.
Definition: log.h:40
#define AST_API
Definition: platform.h:63
void ast_log_stdout(ast_log_level_t level, const char *message)
Log handler that will print message to stdout.
General information message.
Definition: log.h:38
This file includes platform specific definitions.
Non important errors.
Definition: log.h:39
Messages that will only be shown in debug build.
Definition: log.h:37
void ast_log_handler_reg(const ast_log_handler_func_t func)
Register log handler callback function.
ast_log_level_t
Log Level.
Definition: log.h:35