Go to the documentation of this file.
19 #define CHANNELS_LENGTH 500
23 static FILE *file_ptr =
NULL;
24 static char program_name[40];
32 static int channels_on = 0;
34 static int use_blacklist = 0;
56 const char *log_program_name
59 const char *log_level;
60 const char *log_channels;
63 strncpy(program_name, log_program_name,
sizeof(program_name));
64 program_name[
sizeof(program_name) - 1] =
'\0';
70 log_level = getenv(
"IAS_LOG_LEVEL");
71 if ( log_level !=
NULL)
73 if (strcmp(log_level,
"DEBUG") == 0)
75 else if (strcmp(log_level,
"INFO") == 0)
77 else if (strcmp(log_level,
"WARN") == 0)
79 else if (strcmp(log_level,
"ERROR") == 0)
84 "to be 'DEBUG', 'INFO', 'WARN', or 'ERROR'");
93 log_channels = getenv(
"IAS_LOG_CHANNELS");
94 if ( log_channels !=
NULL )
98 IAS_LOG_ERROR(
"Environment variable IAS_LOG_CHANNELS exceeds max "
105 if (strlen(log_channels) > 0 && log_channels[0] ==
'-')
114 sprintf(ias_log_channels,
",%s,", (log_channels+1));
117 sprintf(ias_log_channels,
",%s,", log_channels);
122 ias_log_channels[0] =
'\0';
126 if (setvbuf(file_ptr,
NULL, _IOLBF, 0) !=0)
174 if (setvbuf(new_fp,
NULL, _IOLBF, 0) !=0)
203 ptime =
time((time_t *) 0);
204 if (ptime == ((time_t) - 1))
211 ltime = localtime(&ptime);
219 if (strftime(stamp, stampsize, format, ltime) == 0)
238 static int is_channel_enabled
244 if ( strlen(ias_log_channels) == 0 )
248 char search_str[strlen(channel) + 3];
249 sprintf(search_str,
",%s,", channel);
252 if ( strstr(ias_log_channels, search_str) !=
NULL )
275 static void log_message
285 char temp_string[500];
286 static const char *log_level_message[] = {
"DEBUG",
"INFO",
"WARN",
"ERROR"};
289 if (file_ptr ==
NULL)
303 "IAS_LOG_LEVEL_DEBUG, IAS_LOG_LEVEL_INFO, "
304 "IAS_LOG_LEVEL_WARN, and IAS_LOG_LEVEL_ERROR");
311 vsnprintf(temp_string,
sizeof(temp_string), format, ap);
313 format_time(time_stamp,
sizeof(time_stamp),
"%F %H:%M:%S");
314 fprintf(file_ptr,
"%19s %s %7d %-20s %6d %s %s\n",
315 time_stamp, program_name, pid,
filename,
316 line_number, log_level_message[log_level], temp_string);
334 const char *format, ...
341 va_start(arglist, format);
342 log_message(log_level,
filename, line_number, format, arglist);
362 const char *format, ...
365 if (is_channel_enabled(channel))
368 va_start(arglist, format);
369 log_message(log_level,
filename, line_number, format, arglist);
#define IAS_LOG_WARNING(format,...)
#define IAS_LOG_ERROR(format,...)
IAS_LOG_MESSAGE_LEVEL ias_log_set_output_level(int new_level)
int ias_log_initialize(const char *log_program_name)
char filename[FILENAME_MAX]
char * format_time(double usec)
void ias_log_message(int log_level, const char *filename, int line_number, const char *format,...)
this program makes no use of any feature of the SDP Toolkit that could generate such a then geolocation is calculated at that and then aggregated up to Resolved feature request Bug by adding three new int8 SDSs for each high resolution offsets between the high resolution geolocation and a bi linear interpolation extrapolation of the positions This can be used to reconstruct the high resolution geolocation Resolved Bug by delaying cumulation of gflags until after validation of derived products Resolved Bug by setting Latitude and Longitude to the correct fill resolving to support Near Real Time because they may be unnecessary if use of entrained ephemeris and attitude data is turned resolving bug report Corrected to filter out Aqua attitude records with missing status helping resolve bug MOD_PR03 will still correctly write scan and pixel data that does not depend upon the start time
PARAM_TYPE_NONE Default value No parameter is buried in the product name name_prefix is case insensitive string compared to the product name PARAM_TYPE_VIS_WAVE The visible wavelength bands from the sensor are buried in the product name The product name is compared by appending and name_suffix ie aph_412_giop where prod_ix will be set to PARAM_TYPE_IR_WAVE same search method as PARAM_TYPE_VIS_WAVE except only wavelength above are looped through but prod_ix is still based ie aph_2_giop for the second and prod_ix set to PARAM_TYPE_INT name_prefix is compared with the beginning of the product name If name_suffix is not empty the it must match the end of the product name The characters right after the prefix are read as an integer and prod_ix is set to that number strncpy(l2prod->name_prefix, "myprod", UNITLEN)
void ias_log_message_with_channel(int log_level, const char *channel, const char *filename, int line_number, const char *format,...)
int ias_log_set_output_target(FILE *new_fp)
enum IAS_LOG_MESSAGE_LEVEL ias_log_message_level