afc_log

Name

afc_log  -- Writes a log message to the standard error

Synopsis

int afc_log ( AFC * afc, int level, unsigned int error, const char * class_name, const char * funct_name, const char * descr, const char * info );

Description

This function writes a log text to the application standard error. It is best to use this function instead of custom made error/log reporting routines because it takes care of a lot of things. For example, if a message is below the default user desired log level, no message will be written to the standard error.

Inputs

afc

Pointer to a valid afc instance.

level

Log Level. It can be any of the following:

AFC_LOG_MESSAGE

Just a message, nothing really important

AFC_LOG_NOTICE

Something that the user can be interested in view

AFC_LOG_WARNING

A non serious error, just to let the user know

AFC_LOG_ERROR

A real error

AFC_LOG_CRITICAL

An unrecoverable error occurred. If AFC_TAG_LOG_EXIT_CRITICAL was set to TRUE, then the program will immediately quit.

error

Your own error code to be returned.

class_name

The name of the class raising the error.

funct_name

The name of the function raising the error.

descr

A textual description of the error being raised.

info

Additional string for the error being raised.

Result

this function returns the same error passed in the 'error' parameter. This is useful in cases where you want to write stuff like: return ( afc_log ( ... ) );

See Also