AT&T ECOMP Vendor Event Listener library  0.1
Functions | Variables
evel_logging.c File Reference

Wrapper for event logging built on syslog. More...

#include <string.h>
#include <assert.h>
#include <syslog.h>
#include <stdlib.h>
#include <sys/time.h>
#include <curl/curl.h>
#include "evel.h"
Include dependency graph for evel_logging.c:

Go to the source code of this file.

Functions

void log_initialize (EVEL_LOG_LEVELS level, const char *ident)
 Initialize logging. More...
 
const char * evel_error_string (void)
 Descriptive text for library errors. More...
 
void log_error_state (char *format,...)
 
void log_debug (EVEL_LOG_LEVELS level, char *format,...)
 Generate a debug log. More...
 

Variables

EVEL_LOG_LEVELS debug_level = EVEL_LOG_DEBUG
 
int debug_indent = 0
 

Detailed Description

Wrapper for event logging built on syslog.

License

Copyright(c) <2016>, AT&T Intellectual Property. All other rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by the AT&T.
  4. Neither the name of AT&T nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY AT&T INTELLECTUAL PROPERTY ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL AT&T INTELLECTUAL PROPERTY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file evel_logging.c.

Function Documentation

§ evel_error_string()

const char* evel_error_string ( void  )

Descriptive text for library errors.

Return a text error string that relates to the last failure. May be "<null>" but will never be NULL.

Returns
Text error string.
Note
Must not be freed!

Definition at line 87 of file evel_logging.c.

§ log_debug()

void log_debug ( EVEL_LOG_LEVELS  level,
char *  format,
  ... 
)

Generate a debug log.

Log debug information.

Provides an interface to syslog with formatting of the nesting level so that it's easier to see function entry/exit.

Parameters
[in]levelThe debug level - see EVEL_LOG_LEVELS.
[in]formatThe output formatting in printf style.
[in]...Variable arguments as specified in the format string.

Definition at line 120 of file evel_logging.c.

§ log_error_state()

void log_error_state ( char *  format,
  ... 
)

Definition at line 98 of file evel_logging.c.

§ log_initialize()

void log_initialize ( EVEL_LOG_LEVELS  level,
const char *  ident 
)

Initialize logging.

Parameters
[in]levelThe debugging level - one of EVEL_LOG_LEVELS.
[in]identThe identifier for our logs.

Definition at line 68 of file evel_logging.c.

Variable Documentation

§ debug_indent

int debug_indent = 0

Definition at line 54 of file evel_logging.c.

§ debug_level

Definition at line 52 of file evel_logging.c.