X-shooter Pipeline Reference Manual 3.8.15
Macros | Functions | Variables

Macros

#define MAXSTRINGLENGTH   1024 /* Used to pass a va_list to cpl_msg_warning */
 
#define xsh_msg_dbg_high(...)
 
#define xsh_msg_dbg_medium(...)
 
#define xsh_msg_dbg_low(...)
 
#define xsh_msg_error(...)   cpl_msg_error(__func__, __VA_ARGS__)
 Print an error message.
 
#define xsh_msg_progress(i, iter, ...)
 Print a progress message.
 
#define xsh_msg_warning(...)   xsh_msg_warning_macro(__func__, __VA_ARGS__)
 Print an warning message.
 
#define xsh_msg_debug(...)   cpl_msg_debug(__func__, __VA_ARGS__)
 Print a debug message.
 
#define xsh_msg_indented(...)
 Print an indented message.
 
#define xsh_msg(...)   cpl_msg_info("", __VA_ARGS__)
 Print a message on info level.
 

Functions

void xsh_msg_init (void)
 Initialize messaging.
 
int xsh_msg_get_warnings (void)
 Get number of warnings printed so far.
 
void xsh_msg_warning_macro (const char *fct, const char *format,...)
 Print a warning message.
 

Variables

static int number_of_warnings = 0
 

Detailed Description

This module exists in order to save the user from typing the function name when calling a CPL message function (by using the ANSI-C99 __func__ identifier).

Also, a record is kept on the number of warnings printed using xsh_msg_warning().

These messaging functions never set the CPL error code.

Macro Definition Documentation

◆ MAXSTRINGLENGTH

#define MAXSTRINGLENGTH   1024 /* Used to pass a va_list to cpl_msg_warning */

Definition at line 61 of file xsh_msg.c.

◆ xsh_msg

#define xsh_msg (   ...)    cpl_msg_info("", __VA_ARGS__)

Print a message on info level.

Parameters
...Message to print

See also xsh_msg_macro().

Definition at line 121 of file xsh_msg.h.

◆ xsh_msg_dbg_high

#define xsh_msg_dbg_high (   ...)
Value:
{ \
cpl_msg_debug(__func__, __VA_ARGS__) ; \
}
int xsh_debug_level_get(void)
get debug level
Definition: xsh_utils.c:3142
@ XSH_DEBUG_LEVEL_HIGH
Definition: xsh_utils.h:138

Definition at line 40 of file xsh_msg.h.

◆ xsh_msg_dbg_low

#define xsh_msg_dbg_low (   ...)
Value:
{ \
cpl_msg_debug(__func__, __VA_ARGS__) ; \
}
@ XSH_DEBUG_LEVEL_LOW
Definition: xsh_utils.h:137

Definition at line 48 of file xsh_msg.h.

◆ xsh_msg_dbg_medium

#define xsh_msg_dbg_medium (   ...)
Value:
{ \
cpl_msg_debug(__func__, __VA_ARGS__) ; \
}
@ XSH_DEBUG_LEVEL_MEDIUM
Definition: xsh_utils.h:138

Definition at line 44 of file xsh_msg.h.

◆ xsh_msg_debug

#define xsh_msg_debug (   ...)    cpl_msg_debug(__func__, __VA_ARGS__)

Print a debug message.

Parameters
...Message to print

This function is used instead of cpl_msg_debug(), and saves the user from typing the calling function name.

Definition at line 99 of file xsh_msg.h.

◆ xsh_msg_error

#define xsh_msg_error (   ...)    cpl_msg_error(__func__, __VA_ARGS__)

Print an error message.

Parameters
...Message to print

This function is used instead of cpl_msg_error(), and saves the user from typing the calling function name.

Definition at line 62 of file xsh_msg.h.

◆ xsh_msg_indented

#define xsh_msg_indented (   ...)
Value:
do { \
cpl_msg_indent_more(); \
xsh_msg(__VA_ARGS__); \
cpl_msg_indent_less(); \
} while (false)

Print an indented message.

Parameters
...Message to print

Definition at line 107 of file xsh_msg.h.

◆ xsh_msg_progress

#define xsh_msg_progress (   i,
  iter,
  ... 
)
Value:
cpl_msg_progress(__func__, (i), (iter),\
__VA_ARGS__)

Print a progress message.

Parameters
iSee cpl_msg_progress()
iterSee cpl_msg_progress()
...Message to print

This function is used instead of cpl_msg_progress(), and saves the user from typing the calling function name.

Definition at line 75 of file xsh_msg.h.

◆ xsh_msg_warning

#define xsh_msg_warning (   ...)    xsh_msg_warning_macro(__func__, __VA_ARGS__)

Print an warning message.

Parameters
...Message to print

This function is used instead of cpl_msg_warning(), and saves the user from typing the calling function name.

Additionally the number of warnings printed so far is

Definition at line 88 of file xsh_msg.h.

Function Documentation

◆ xsh_msg_get_warnings()

int xsh_msg_get_warnings ( void  )

Get number of warnings printed so far.

Returns
Number of warnings since initialization of messaging

Definition at line 116 of file xsh_msg.c.

References number_of_warnings.

Referenced by xsh_end().

◆ xsh_msg_init()

void xsh_msg_init ( void  )

Initialize messaging.

This function

  • resets the number of warnings printed,
  • sets the message output format.

Definition at line 80 of file xsh_msg.c.

References number_of_warnings.

Referenced by xsh_init().

◆ xsh_msg_warning_macro()

void xsh_msg_warning_macro ( const char *  fct,
const char *  format,
  ... 
)

Print a warning message.

Parameters
fctIdentity of calling function
formatA printf()-like format string

Don't call this function directly, use the macro xsh_msg_warning().

This function is used instead of cpl_msg_warning(), and saves the user from typing the calling function name.

Additionally, record is kept on the total number of warnings printed (see xsh_msg_get_warnings()).

Definition at line 137 of file xsh_msg.c.

References MAXSTRINGLENGTH, and number_of_warnings.

Variable Documentation

◆ number_of_warnings

int number_of_warnings = 0
static

Definition at line 66 of file xsh_msg.c.

Referenced by xsh_msg_get_warnings(), xsh_msg_init(), and xsh_msg_warning_macro().