Libann

Libann: Miscellaneous Features


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5. Miscellaneous Features


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.1 Version Number

A string containing the version of the library can be obtained by calling the global function ann::version(). This is declared in `ann/ann.h'.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

5.2 Logging

There is a simple logging facility. Primarily it's there to assist debugging of Libann itself, but you may use it for other purposes. Logging features are declared in `ann/log.h'.

To log a string, call the global function ann::log() which returns an std::ostream, and stream the string to it(1).

 
using namespace ann;

int
main()
{
  log() << "Start of program" << std::endl;

  log() << "End of program" << std::endl;

  return 0;
}

By default, anything streamed to the object returned by log() will go to `/dev/null'. This behaviour can be changed however by calling ann::setLogStream or ann::setLogFile. These functions take a std::ostream and a std::string respectively, which refer to the stream or file to which all future logging should be done.

Currently there is no facility for different levels (priorities) of logging.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by John Darrington on May, 15 2003 using texi2html

[Home] [Frequently Asked Questions] [News] [Development] [Links] [Using and Installing] [Download] [Licence]