Changeset 3805


Ignore:
Timestamp:
Aug 31, 2012 8:58:01 AM (7 years ago)
Author:
Iakov Nakhimovski
Message:

Added unfinished query handling routines to FMILU, see #2040

Location:
FMILibraryUtilities/trunk/Ideas
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • FMILibraryUtilities/trunk/Ideas/fmi1_callbacks.c

    r3533 r3805  
    129129void fmi1_logger(jm_callbacks* cb, jm_string module, jm_log_level_enu_t log_level, jm_string message) {
    130130    fmi1_callbacks_t* c = (fmi1_callbacks_t*)cb->context;
     131    fmi1_status_t status;
    131132    if(!c ||!c->fmiFunctions.logger) return;
    132     switch(log_level) {
    133     case jm_log_level_all:
    134     case jm_log_level_info:
    135         c->fmiFunctions.logger( c, module, fmi1_status_ok, "INFO", message);
    136         break;
    137     case jm_log_level_warning:
    138         c->fmiFunctions.logger( c, module, fmi1_status_warning, "WARNING", message);
    139         break;
    140     default:
    141         c->fmiFunctions.logger( c, module, fmi1_status_error, "ERROR", message);
     133
     134    if(log_level > jm_log_level_all) {
     135        assert(0);
     136        status = fmi1_status_error;
    142137    }
     138    else if(log_level >= jm_log_level_info)
     139        status = fmi1_status_ok;
     140    else if(log_level >= jm_log_level_warning)
     141        status = fmi1_status_warning;
     142    else if(log_level >= jm_log_level_error)
     143        status = fmi1_status_error;
     144    else if(log_level >= jm_log_level_fatal)
     145        status = fmi1_status_fatal;
     146    else {
     147        assert(0);
     148        status = fmi1_status_error;
     149    }
     150
     151    c->fmiFunctions.logger( c, module, status, jm_log_level_to_string(log_level), message);
    143152}
    144153
  • FMILibraryUtilities/trunk/Ideas/fmi1_callbacks.h

    r3534 r3805  
    2525#endif
    2626/** \file fmi1_callbacks.h
    27     Support for FMI callbacks.
     27    \brief Support for FMI callbacks.
    2828*/
    2929
     
    3232*/
    3333/**
    34 \name Replacing system malloc/calloc/realloc/free
     34\todo Replacing system malloc/calloc/realloc/free on export
    3535
    3636    NOTE: THIS IS NOT FULLY IMPLEMENTED
     
    4747@{
    4848
    49 Mapping of FMI callbacks to ::jm_callbacks*/
     49Mapping of FMI callbacks to ::jm_callbacks */
    5050typedef struct fmi1_callbacks_t {
    5151    jm_callbacks jmFunctions;
     
    6161} fmi1_memory_header_t;
    6262
    63 /** Initialize ::fmi1_callback_functions_t structure to map jm library callback functions onto fmi callbacks */
     63/** \brief Initialize ::fmi1_callback_functions_t structure to map jm library callback functions onto fmi callbacks
     64    \param callbacks the
     65*/
    6466void fmi1_export_init_callbacks(fmi1_callbacks_t* callbacks, fmi1_callback_functions_t* fmiFunctions);
    6567/** @}
Note: See TracChangeset for help on using the changeset viewer.