| 1 |
|
| 2 |
#ifndef AWS_COMMON_LOG_CHANNEL_H |
| 3 |
#define AWS_COMMON_LOG_CHANNEL_H |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
#include <aws/common/common.h> |
| 11 |
|
| 12 |
#include <aws/common/logging.h> |
| 13 |
|
| 14 |
AWS_PUSH_SANE_WARNING_LEVEL |
| 15 |
|
| 16 |
struct aws_string; |
| 17 |
struct aws_log_writer; |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
struct aws_log_channel; |
| 26 |
|
| 27 |
typedef int(aws_log_channel_send_fn)(struct aws_log_channel *channel, struct aws_string *output); |
| 28 |
typedef void(aws_log_channel_clean_up_fn)(struct aws_log_channel *channel); |
| 29 |
|
| 30 |
struct aws_log_channel_vtable { |
| 31 |
aws_log_channel_send_fn *send; |
| 32 |
aws_log_channel_clean_up_fn *clean_up; |
| 33 |
}; |
| 34 |
|
| 35 |
struct aws_log_channel { |
| 36 |
struct aws_log_channel_vtable *vtable; |
| 37 |
struct aws_allocator *allocator; |
| 38 |
struct aws_log_writer *writer; |
| 39 |
void *impl; |
| 40 |
}; |
| 41 |
|
| 42 |
AWS_EXTERN_C_BEGIN |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
AWS_COMMON_API |
| 50 |
int aws_log_channel_init_foreground( |
| 51 |
struct aws_log_channel *channel, |
| 52 |
struct aws_allocator *allocator, |
| 53 |
struct aws_log_writer *writer); |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
AWS_COMMON_API |
| 61 |
int aws_log_channel_init_background( |
| 62 |
struct aws_log_channel *channel, |
| 63 |
struct aws_allocator *allocator, |
| 64 |
struct aws_log_writer *writer); |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
AWS_COMMON_API |
| 70 |
void aws_log_channel_clean_up(struct aws_log_channel *channel); |
| 71 |
|
| 72 |
AWS_EXTERN_C_END |
| 73 |
AWS_POP_SANE_WARNING_LEVEL |
| 74 |
|
| 75 |
#endif |