OB.DAAC Logo
NASA Logo
Ocean Color Science Software

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

Go to the source code of this file.

Macros

#define PRINT_FORMAT_ATTRIBUTE   __attribute__ ((format(printf,4,5)))
 
#define PRINT_FORMAT_ATTRIBUTE_WC   __attribute__ ((format(printf,5,6)))
 
#define IAS_LOG_DEBUG_ENABLED()   (((IAS_LOG_LEVEL_DEBUG) >= (ias_log_message_level)) ? (1) : (0))
 
#define IAS_LOG_ERROR(format, ...)   ias_log_message(IAS_LOG_LEVEL_ERROR,__FILE__,__LINE__,format,##__VA_ARGS__)
 
#define IAS_LOG_WARNING(format, ...)
 
#define IAS_LOG_INFO(format, ...)
 
#define IAS_LOG_DEBUG(format, ...)
 
#define IAS_LOG_DEBUG_TO_CHANNEL(channel, format, ...)
 

Enumerations

enum  IAS_LOG_MESSAGE_LEVEL {
  IAS_LOG_LEVEL_DEBUG = 0, IAS_LOG_LEVEL_INFO, IAS_LOG_LEVEL_WARN, IAS_LOG_LEVEL_ERROR,
  IAS_LOG_LEVEL_DISABLE
}
 

Functions

int ias_log_initialize (const char *log_program_name)
 
IAS_LOG_MESSAGE_LEVEL ias_log_set_output_level (int new_level)
 
int ias_log_set_output_target (FILE *new_fp)
 
void ias_log_message (int log_level, const char *filename, int line_number, const char *format,...) PRINT_FORMAT_ATTRIBUTE
 
void ias_log_message_with_channel (int log_level, const char *channel, const char *filename, int line_number, const char *format,...) PRINT_FORMAT_ATTRIBUTE_WC
 

Variables

enum IAS_LOG_MESSAGE_LEVEL ias_log_message_level
 

Macro Definition Documentation

◆ IAS_LOG_DEBUG

#define IAS_LOG_DEBUG (   format,
  ... 
)
Value:
ias_log_message(IAS_LOG_LEVEL_DEBUG,__FILE__,__LINE__, \
format,##__VA_ARGS__)

Definition at line 113 of file ias_logging.h.

◆ IAS_LOG_DEBUG_ENABLED

#define IAS_LOG_DEBUG_ENABLED ( )    (((IAS_LOG_LEVEL_DEBUG) >= (ias_log_message_level)) ? (1) : (0))

Definition at line 92 of file ias_logging.h.

◆ IAS_LOG_DEBUG_TO_CHANNEL

#define IAS_LOG_DEBUG_TO_CHANNEL (   channel,
  format,
  ... 
)
Value:
ias_log_message_with_channel(IAS_LOG_LEVEL_DEBUG, channel, \
__FILE__, __LINE__, format, ##__VA_ARGS__)

Definition at line 125 of file ias_logging.h.

◆ IAS_LOG_ERROR

#define IAS_LOG_ERROR (   format,
  ... 
)    ias_log_message(IAS_LOG_LEVEL_ERROR,__FILE__,__LINE__,format,##__VA_ARGS__)

Definition at line 96 of file ias_logging.h.

◆ IAS_LOG_INFO

#define IAS_LOG_INFO (   format,
  ... 
)
Value:
ias_log_message(IAS_LOG_LEVEL_INFO,__FILE__,__LINE__, \
format,##__VA_ARGS__)

Definition at line 106 of file ias_logging.h.

◆ IAS_LOG_WARNING

#define IAS_LOG_WARNING (   format,
  ... 
)
Value:
ias_log_message(IAS_LOG_LEVEL_WARN,__FILE__,__LINE__, \
format,##__VA_ARGS__)

Definition at line 100 of file ias_logging.h.

◆ PRINT_FORMAT_ATTRIBUTE

#define PRINT_FORMAT_ATTRIBUTE   __attribute__ ((format(printf,4,5)))

Definition at line 40 of file ias_logging.h.

◆ PRINT_FORMAT_ATTRIBUTE_WC

#define PRINT_FORMAT_ATTRIBUTE_WC   __attribute__ ((format(printf,5,6)))

Definition at line 41 of file ias_logging.h.

Enumeration Type Documentation

◆ IAS_LOG_MESSAGE_LEVEL

Enumerator
IAS_LOG_LEVEL_DEBUG 
IAS_LOG_LEVEL_INFO 
IAS_LOG_LEVEL_WARN 
IAS_LOG_LEVEL_ERROR 
IAS_LOG_LEVEL_DISABLE 

Definition at line 45 of file ias_logging.h.

Function Documentation

◆ ias_log_initialize()

int ias_log_initialize ( const char *  log_program_name)

Definition at line 55 of file ias_logging.c.

◆ ias_log_message()

void ias_log_message ( int  log_level,
const char *  filename,
int  line_number,
const char *  format,
  ... 
)

Definition at line 330 of file ias_logging.c.

◆ ias_log_message_with_channel()

void ias_log_message_with_channel ( int  log_level,
const char *  channel,
const char *  filename,
int  line_number,
const char *  format,
  ... 
)

Definition at line 357 of file ias_logging.c.

◆ ias_log_set_output_level()

IAS_LOG_MESSAGE_LEVEL ias_log_set_output_level ( int  new_level)

Definition at line 144 of file ias_logging.c.

◆ ias_log_set_output_target()

int ias_log_set_output_target ( FILE *  new_fp)

Definition at line 167 of file ias_logging.c.

Variable Documentation

◆ ias_log_message_level

enum IAS_LOG_MESSAGE_LEVEL ias_log_message_level

Definition at line 22 of file ias_logging.c.

enum IAS_LOG_MESSAGE_LEVEL ias_log_message_level
Definition: ias_logging.c:22
@ IAS_LOG_LEVEL_WARN
Definition: ias_logging.h:48
@ IAS_LOG_LEVEL_DEBUG
Definition: ias_logging.h:46
@ IAS_LOG_LEVEL_INFO
Definition: ias_logging.h:47