Galago - desktop presence framework

galago-log.h File Reference

Log API. More...

#include <stdarg.h>
#include <libgalago/galago-types.h>

Go to the source code of this file.


Defines

#define __attribute__(x)

Typedefs

typedef void(* GalagoLogHandlerFunc )(GalagoLogLevel, const char *, va_list args, void *)

Enumerations

enum  GalagoLogLevel {
  GALAGO_LOG_ALL = 0, GALAGO_LOG_MISC, GALAGO_LOG_INFO, GALAGO_LOG_WARNING,
  GALAGO_LOG_ERROR, GALAGO_LOG_FATAL, GALAGO_LOG_ASSERT, GALAGO_LOG_NUM_LEVELS
}
 Log levels. More...

Functions

void galago_log_set_enabled (GalagoLogLevel level, galago_bool enabled)
 Sets whether or not log output is enabled for a level.
void galago_log_set_handler (GalagoLogLevel level, GalagoLogHandlerFunc func, void *user_data)
 Sets up a handler for logging information.
void galago_log_unset_handler (GalagoLogLevel level)
 Unsets a logging handler.
void galago_log (GalagoLogLevel level, const char *format,...)
 Outputs log information.
void galago_log_args (GalagoLogLevel level, const char *format, va_list args)
 Outpus log information.
void galago_log_misc (const char *format,...)
 Outputs misc.
void galago_log_info (const char *format,...)
 Outputs info level log information.
void galago_log_warning (const char *format,...)
 Outputs warning level log information.
void galago_log_error (const char *format,...)
 Outputs error level log information.
void galago_log_fatal (const char *format,...)
 Outputs fatal level log information.

Detailed Description

Log API.

Copyright:
(C) 2004-2005 Christian Hammond
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Definition in file galago-log.h.


Enumeration Type Documentation

enum GalagoLogLevel
 

Log levels.

Enumeration values:
GALAGO_LOG_ALL  All log levels.
GALAGO_LOG_MISC  General chatter.
GALAGO_LOG_INFO  General operation information.
GALAGO_LOG_WARNING  Warnings.
GALAGO_LOG_ERROR  Errors.
GALAGO_LOG_FATAL  Fatal errors.
GALAGO_LOG_ASSERT  Assertion errors.
GALAGO_LOG_NUM_LEVELS  The number of log levels.

Definition at line 30 of file galago-log.h.


Function Documentation

void galago_log GalagoLogLevel  level,
const char *  format,
  ...
 

Outputs log information.

Parameters:
level The log level.
format The format string.
... The format parameters.

void galago_log_args GalagoLogLevel  level,
const char *  format,
va_list  args
 

Outpus log information.

This is different from galagoLog() in that it takes a va_list.

Parameters:
level The log level.
format The format string.
args The format parameters.
See also:
galago_log()

void galago_log_error const char *  format,
  ...
 

Outputs error level log information.

This is a wrapper for galago_log(), and uses GALAGO_LOG_ERROR as the level.

Parameters:
format The format string.
... The format parameters.

void galago_log_fatal const char *  format,
  ...
 

Outputs fatal level log information.

This is a wrapper for galago_log(), and uses GALAGO_LOG_FATAL as the level.

Parameters:
format The format string.
... The format parameters.

void galago_log_info const char *  format,
  ...
 

Outputs info level log information.

This is a wrapper for galago_log(), and uses GALAGO_LOG_INFO as the level.

Parameters:
format The format string.
... The format parameters.

void galago_log_misc const char *  format,
  ...
 

Outputs misc.

level log information.

This is a wrapper for galago_log(), and uses GALAGO_LOG_MISC as the level.

Parameters:
format The format string.
... The format parameters.

void galago_log_set_enabled GalagoLogLevel  level,
galago_bool  enabled
 

Sets whether or not log output is enabled for a level.

If level is GALAGO_LOG_ALL, the enabled state will be set for all levels. The other levels may then be enabled or disabled on a per-level basis.

Parameters:
level The log level.
enabled Whether or not log output is enabled.

void galago_log_set_handler GalagoLogLevel  level,
GalagoLogHandlerFunc  func,
void *  user_data
 

Sets up a handler for logging information.

Parameters:
level The log level.
func The handler function.
user_data Optional user-specific data.

void galago_log_unset_handler GalagoLogLevel  level  ) 
 

Unsets a logging handler.

This is equivalent to calling galago_log_set_handler(level, func, NULL);

Parameters:
level The log level.

void galago_log_warning const char *  format,
  ...
 

Outputs warning level log information.

This is a wrapper for galago_log(), and uses GALAGO_LOG_WARNING as the level.

Parameters:
format The format string.
... The format parameters.