OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
streamf.h
Go to the documentation of this file.
1 
2 #ifndef __OLOG_STREAMF_H_
3 #define __OLOG_STREAMF_H_
4 
5 #include "olog.h"
6 #include "phash.h"
7 
8 #include <stdio.h>
9 #include <stdlib.h>
10 
11 typedef struct olog_streamf_arguments {
13  FILE *stream;
15  size_t strftime_size;
20 
21 // TODO: figure out how not to expose this stuff
22 
23 typedef int (*olog_print_callback) (olog *olog, olog_backend *backend, uint8_t severity, va_list args);
24 typedef int (*olog_print_callback_no_vargs) (olog *olog, olog_backend *backend, uint8_t severity);
26 
32 
35 };
37 typedef struct print_command {
39  void *data;
41 
42 
43 typedef struct olog_streamf {
44  char *filename;
45  FILE *stream;
47  size_t strftime_size;
51  unsigned command_count;
52 } olog_streamf;
53 
54 olog_backend olog_backend_streamf(olog_streamf_arguments *arguments, int8_t min_log_level, int8_t max_log_level);
55 
56 #endif /* __OLOG_STREAMF_H_ */
@ STREAMF_TYPE_FUNCTION
Definition: streamf.h:29
int(* olog_print_callback_no_args)(olog *olog, olog_backend *backend)
Definition: streamf.h:25
A simple logger, capable of dispatching log events to multiple end points.
A simple dictionary library for storing pointers.
char * strftime_format
Definition: streamf.h:14
int(* olog_print_callback)(olog *olog, olog_backend *backend, uint8_t severity, va_list args)
Definition: streamf.h:23
size_t strftime_size
Definition: streamf.h:47
char * format
Definition: streamf.h:46
streamf_type type
Definition: streamf.h:38
char * filename
Definition: streamf.h:44
void ** indexed_pointers
Definition: streamf.h:18
Definition: olog.c:11
Implementation-specific, generic type to store the phash object.
Definition: phash.c:40
@ STREAMF_TYPE_STRING
Definition: streamf.h:28
FILE * stream
Definition: streamf.h:45
unsigned command_count
Definition: streamf.h:51
enum streamf_type_t streamf_type
Definition: streamf.h:36
@ STREAMF_TYPE_LOOKUP_HASH
Definition: streamf.h:33
int(* olog_print_callback_no_vargs)(olog *olog, olog_backend *backend, uint8_t severity)
Definition: streamf.h:24
print_command * commands
Definition: streamf.h:50
char * strftime_format
Definition: streamf.h:46
@ STREAMF_TYPE_LOOKUP_ARRAY
Definition: streamf.h:34
void * data
Definition: streamf.h:39
streamf_type_t
Definition: streamf.h:27
phash * named_pointers
Definition: streamf.h:17
phash * named_pointers
Definition: streamf.h:48
@ STREAMF_TYPE_FUNCTION_NO_VARGS
Definition: streamf.h:30
void ** indexed_pointers
Definition: streamf.h:49
@ STREAMF_TYPE_FUNCTION_NO_ARGS
Definition: streamf.h:31
olog_backend olog_backend_streamf(olog_streamf_arguments *arguments, int8_t min_log_level, int8_t max_log_level)
Definition: streamf.c:362