OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
olog.h File Reference
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
Include dependency graph for olog.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  olog_backend
 

Macros

#define OLOG_DEBUG   0
 
#define OLOG_INFO   1
 
#define OLOG_NOTICE   2
 
#define OLOG_WARNING   3
 
#define OLOG_ERROR   4
 
#define OLOG_CRITICAL   5
 
#define OLOG_ALERT   6
 
#define OLOG_EMERGENCY   7
 
#define OLOG_CONTINUE   0
 
#define OLOG_NOERROR   0
 
#define OLOG_EXPLODED   1
 
#define OLOG_STOP   255
 
#define olog_print_verbose(olog, level, ...)
 

Typedefs

typedef int(* olog_print_callback) (olog *olog, olog_backend *backend, uint8_t severity, va_list args)
 
typedef int(* olog_destroy_callback) (olog *olog, olog_backend *backend)
 
typedef int(* olog_has_error_callback) (olog *olog, olog_backend *backend)
 
typedef int(* olog_print_error_callback) (olog *olog, olog_backend *backend, FILE *stream)
 

Functions

ologolog_create (olog_backend *backends, FILE *stream)
 
void olog_destroy (olog *olog)
 
bool olog_has_error (olog *olog)
 
bool olog_print_error (olog *olog, FILE *stream)
 
int olog_print (olog *olog, int level,...)
 
int olog_vprint (olog *olog, int8_t level, va_list args)
 
int olog_debug (olog *olog,...)
 
int olog_info (olog *olog,...)
 
int olog_notice (olog *olog,...)
 
int olog_warn (olog *olog,...)
 
int olog_err (olog *olog,...)
 
int olog_crit (olog *olog,...)
 
int olog_emerg (olog *olog,...)
 

Variables

ologolog_global_log
 
char * olog_global_config
 
olog_backend olog_backends_end
 

Detailed Description

A simple logger, capable of dispatching log events to multiple end points.

olog is meant to be as simple as possible to use, configure, and extend.

Definition in file olog.h.

Macro Definition Documentation

◆ OLOG_ALERT

#define OLOG_ALERT   6

Definition at line 48 of file olog.h.

◆ OLOG_CONTINUE

#define OLOG_CONTINUE   0

Definition at line 51 of file olog.h.

◆ OLOG_CRITICAL

#define OLOG_CRITICAL   5

Definition at line 47 of file olog.h.

◆ OLOG_DEBUG

#define OLOG_DEBUG   0

Definition at line 42 of file olog.h.

◆ OLOG_EMERGENCY

#define OLOG_EMERGENCY   7

Definition at line 49 of file olog.h.

◆ OLOG_ERROR

#define OLOG_ERROR   4

Definition at line 46 of file olog.h.

◆ OLOG_EXPLODED

#define OLOG_EXPLODED   1

Definition at line 53 of file olog.h.

◆ OLOG_INFO

#define OLOG_INFO   1

Definition at line 43 of file olog.h.

◆ OLOG_NOERROR

#define OLOG_NOERROR   0

Definition at line 52 of file olog.h.

◆ OLOG_NOTICE

#define OLOG_NOTICE   2

Definition at line 44 of file olog.h.

◆ olog_print_verbose

#define olog_print_verbose (   olog,
  level,
  ... 
)
Value:
do { \
olog_print(olog, level, __VA_ARGS__); \
olog_print(olog, level, "Previous message at %s:%d\n", __FILE__, __LINE__); \
} while (0)

Definition at line 108 of file olog.h.

◆ OLOG_STOP

#define OLOG_STOP   255

Definition at line 54 of file olog.h.

◆ OLOG_WARNING

#define OLOG_WARNING   3

Definition at line 45 of file olog.h.

Typedef Documentation

◆ olog_destroy_callback

typedef int(* olog_destroy_callback) (olog *olog, olog_backend *backend)

Definition at line 60 of file olog.h.

◆ olog_has_error_callback

typedef int(* olog_has_error_callback) (olog *olog, olog_backend *backend)

Definition at line 61 of file olog.h.

◆ olog_print_callback

typedef int(* olog_print_callback) (olog *olog, olog_backend *backend, uint8_t severity, va_list args)

Definition at line 59 of file olog.h.

◆ olog_print_error_callback

typedef int(* olog_print_error_callback) (olog *olog, olog_backend *backend, FILE *stream)

Definition at line 62 of file olog.h.

Function Documentation

◆ olog_create()

olog* olog_create ( olog_backend backends,
FILE *  stream 
)

Definition at line 15 of file olog.c.

◆ olog_crit()

int olog_crit ( olog olog,
  ... 
)

◆ olog_debug()

int olog_debug ( olog olog,
  ... 
)

◆ olog_destroy()

void olog_destroy ( olog olog)

Definition at line 60 of file olog.c.

◆ olog_emerg()

int olog_emerg ( olog olog,
  ... 
)

◆ olog_err()

int olog_err ( olog olog,
  ... 
)

◆ olog_has_error()

bool olog_has_error ( olog olog)

Definition at line 73 of file olog.c.

◆ olog_info()

int olog_info ( olog olog,
  ... 
)

◆ olog_notice()

int olog_notice ( olog olog,
  ... 
)

◆ olog_print()

int olog_print ( olog olog,
int  level,
  ... 
)

Definition at line 117 of file olog.c.

◆ olog_print_error()

bool olog_print_error ( olog olog,
FILE *  stream 
)

Definition at line 86 of file olog.c.

◆ olog_vprint()

int olog_vprint ( olog olog,
int8_t  level,
va_list  args 
)

Definition at line 100 of file olog.c.

◆ olog_warn()

int olog_warn ( olog olog,
  ... 
)

Variable Documentation

◆ olog_backends_end

olog_backend olog_backends_end

Definition at line 10 of file olog_loader.c.

◆ olog_global_config

char* olog_global_config

Definition at line 9 of file olog_loader.c.

◆ olog_global_log

olog* olog_global_log

Definition at line 8 of file olog_loader.c.

Definition: olog.c:11
level
Definition: mapgen.py:186