Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

log.C File Reference


Detailed Description

Interface to syslog

Definition in file log.C.

#include "Util/log.H"
#include "rutz/compat_snprintf.h"
#include "rutz/demangle.h"
#include "rutz/error_context.h"
#include <cerrno>
#include <cstdarg>
#include <cstdlib>
#include <cstdio>
#include <stdexcept>
#include <sys/types.h>
#include <unistd.h>
#include <cstring>

Include dependency graph for log.C:

Go to the source code of this file.

Defines

#define LBS   1024
 total max size of a log entry

Functions

void sendlog_aux (const char *raw_msg, const int level, const int flags)
 A little helper function for sendlog().
int snprintf (char *str, size_t n, const char *format,...)
int vsnprintf (char *str, size_t n, const char *format, va_list ap)
void sendlog (const char *msg,...)
 Send a log. NON-GNUC, thread-unsafe version.
void report_current_exception (const int line, const char *file) throw ()
 Helper function for REPORT_CURRENT_EXCEPTION macro.

Variables

int LOG_FLAGS
 Bitwise-or'ed combination of above flags.
int MYLOGVERB = LOG_INFO
const char * MYLOGPREFIX = 0
 Null by default, but if set to non-null this string will be prefixed to every log message.
char MYLOGFUN [LBS2]
char MYLOGFIL [LBS2]
int MYLOGLIN
int MYLOGLEV
int MYLOGIDVAL
bool MYLOG_USEP
bool MYLOG_USEID


Define Documentation

#define LBS   1024
 

total max size of a log entry

Definition at line 54 of file log.C.

Referenced by sendlog().


Function Documentation

void report_current_exception const int  line,
const char *  file
throw ()
 

Helper function for REPORT_CURRENT_EXCEPTION macro.

Definition at line 315 of file log.C.

References rutz::demangled_name(), and e.

void sendlog const char *  msg,
  ...
 

Send a log. NON-GNUC, thread-unsafe version.

Definition at line 256 of file log.C.

References i, LBS, LBS2, LOG_FLAGS, MYLOG_USEID, MYLOG_USEP, MYLOGFIL, MYLOGFUN, MYLOGIDVAL, MYLOGLEV, MYLOGLIN, MYLOGVERB, sendlog_aux(), snprintf(), and vsnprintf().

void @0::sendlog_aux const char *  raw_msg,
const int  level,
const int  flags
[static]
 

A little helper function for sendlog().

This avoids duplicating the flag-parsing logic between our two versions of sendlog().

Definition at line 93 of file log.C.

References rutz::error_context::current(), LFATAL_PRINTS_ABORT, LFATAL_THROWS, LFATAL_XTRA_NOISY, LOG_FULLTRACE, aux::msg(), MYLOGPREFIX, and rutz::error_context::prepend_to().

Referenced by sendlog().


Variable Documentation

int LOG_FLAGS
 

Initial value:

Bitwise-or'ed combination of above flags.

Definition at line 56 of file log.C.

Referenced by main(), mexFunction(), and sendlog().

const char* MYLOGPREFIX = 0
 

Null by default, but if set to non-null this string will be prefixed to every log message.

This can be useful if you have multiple threads or multiple processes all writing to stdout, and you want to have some way to distinguish their log messages.

Definition at line 66 of file log.C.

Referenced by handlesignal(), run_master(), run_slave(), and sendlog_aux().

int MYLOGVERB = LOG_INFO
 

Log verbosity (see <syslog.h> for possible values). Default value is LOG_DEBUG. Executables don't need to do anything special unless they need a non-default value.

Definition at line 60 of file log.C.

Referenced by BeoSubSaliency::BeoSubSaliency(), ColorTracker::ColorTracker(), RawVisualCortex::combineOutputs(), ComplexChannel::combineOutputs(), IntegerRawVisualCortex::combineOutputsInt(), IntegerComplexChannel::combineOutputsInt(), SingleChannel::combineSubMaps(), ComplexObject::ComplexObject(), RawVisualCortex::getChannelOutputMap(), SpectralResidualChannel::getOutput(), IntegerSimpleChannel::getOutputInt(), SingleChannel::getRawCSmap(), IntegerSimpleChannel::getRawCSmapInt(), IntegerSimpleChannel::getSubmapInt(), main(), BeoMap::makePanorama(), mexFunction(), ModelManager::paramChanged(), SingleChannel::postProcessMap(), dummy_namespace_to_avoid_gcc411_bug_CmdlineOptionManager_C::printFullHelp(), BeoChip::run(), BeeSTEM::run(), run_master(), run_slave(), sendlog(), RobotBrainServiceService::start(), submain(), BeoChip::writeByte(), and BeeSTEM::writeByte().


Generated on Sun Nov 22 13:45:09 2009 for iLab Neuromorphic Vision Toolkit by  doxygen 1.4.4