minor documentation update
This commit is contained in:
parent
07252d2424
commit
77fcb0ad25
@ -5,10 +5,13 @@
|
||||
// James Turk (jpt2433@rit.edu)
|
||||
//
|
||||
// Version:
|
||||
// $Id: LogSink.h,v 1.1 2005/01/27 03:35:23 cozman Exp $
|
||||
// $Id: LogSink.h,v 1.2 2005/01/27 05:24:11 cozman Exp $
|
||||
//
|
||||
// Revisions:
|
||||
// $Log: LogSink.h,v $
|
||||
// Revision 1.2 2005/01/27 05:24:11 cozman
|
||||
// minor documentation update
|
||||
//
|
||||
// Revision 1.1 2005/01/27 03:35:23 cozman
|
||||
// initial import (exceptions,types, and logging,oh my!)
|
||||
//
|
||||
@ -23,6 +26,8 @@
|
||||
namespace photon
|
||||
{
|
||||
|
||||
// Title: Logging Utilities
|
||||
|
||||
// Enum: LogLevel
|
||||
// Enumeration defining severity of an error.
|
||||
//
|
||||
@ -48,6 +53,11 @@ enum LogLevel
|
||||
// Base class for all LogSinks to be used with <Log>, derived classes must
|
||||
// define message(LogLevel level, std::string string).
|
||||
// A LogSink recieves any messages passed to the log it's registered with.
|
||||
//
|
||||
// Children:
|
||||
// <ConsoleSink>
|
||||
// <TextSink>
|
||||
// <HTMLSink>
|
||||
class LogSink
|
||||
{
|
||||
|
||||
@ -109,6 +119,12 @@ private:
|
||||
|
||||
// Class: ConsoleSink
|
||||
// <LogSink> to be used with <Log> for simple console output.
|
||||
//
|
||||
// See Also:
|
||||
// <TextSink>, <HTMLSink>
|
||||
//
|
||||
// Parent:
|
||||
// <LogSink>
|
||||
class ConsoleSink : public LogSink
|
||||
{
|
||||
public:
|
||||
@ -120,6 +136,12 @@ public:
|
||||
|
||||
// Class: TextSink
|
||||
// <LogSink> to be used with <Log> for simple text file output.
|
||||
//
|
||||
// See Also:
|
||||
// <ConsoleSink>, <HTMLSink>
|
||||
//
|
||||
// Parent:
|
||||
// <LogSink>
|
||||
class TextSink : public LogSink
|
||||
{
|
||||
public:
|
||||
@ -131,13 +153,19 @@ private:
|
||||
std::ofstream out_;
|
||||
};
|
||||
|
||||
// Class: HtmlSink
|
||||
// Class: HTMLSink
|
||||
// <LogSink> to be used with <Log> for simple HTML output.
|
||||
class HtmlSink : public LogSink
|
||||
//
|
||||
// See Also:
|
||||
// <TextSink>, <ConsoleSink>
|
||||
//
|
||||
// Parent:
|
||||
// <LogSink>
|
||||
class HTMLSink : public LogSink
|
||||
{
|
||||
public:
|
||||
HtmlSink(std::string name, bool dynamic=false);
|
||||
virtual ~HtmlSink();
|
||||
HTMLSink(std::string name, bool dynamic=false);
|
||||
virtual ~HTMLSink();
|
||||
|
||||
virtual void writeMessage(LogLevel level, std::string msg);
|
||||
private:
|
||||
|
@ -5,10 +5,13 @@
|
||||
// James Turk (jpt2433@rit.edu)
|
||||
//
|
||||
// Version:
|
||||
// $Id: exceptions.h,v 1.1 2005/01/27 03:35:23 cozman Exp $
|
||||
// $Id: exceptions.h,v 1.2 2005/01/27 05:24:11 cozman Exp $
|
||||
//
|
||||
// Revisions:
|
||||
// $Log: exceptions.h,v $
|
||||
// Revision 1.2 2005/01/27 05:24:11 cozman
|
||||
// minor documentation update
|
||||
//
|
||||
// Revision 1.1 2005/01/27 03:35:23 cozman
|
||||
// initial import (exceptions,types, and logging,oh my!)
|
||||
//
|
||||
@ -23,6 +26,8 @@
|
||||
namespace photon
|
||||
{
|
||||
|
||||
// Title: Exception/Error Types
|
||||
|
||||
// Class: Throwable
|
||||
// Throwable is the base exception class for Photon.
|
||||
//
|
||||
@ -54,7 +59,7 @@ private:
|
||||
// recoverable.
|
||||
//
|
||||
// See Also:
|
||||
// <Error>
|
||||
// <Error>
|
||||
//
|
||||
// Parent:
|
||||
// <Throwable>
|
||||
@ -188,6 +193,8 @@ public:
|
||||
};
|
||||
|
||||
|
||||
// Section: Utility Functions
|
||||
|
||||
// Function: require
|
||||
// Similar to an assert, given a condition checks if it is true, and if it is
|
||||
// not, throws an exception.
|
||||
|
1
ndoc/ndoc.sh
Normal file
1
ndoc/ndoc.sh
Normal file
@ -0,0 +1 @@
|
||||
NaturalDocs -nag -i ../include -o HTML ../docs -p .
|
@ -5,10 +5,13 @@
|
||||
// James Turk (jpt2433@rit.edu)
|
||||
//
|
||||
// Version:
|
||||
// $Id: LogSink.cpp,v 1.1 2005/01/27 03:35:24 cozman Exp $
|
||||
// $Id: LogSink.cpp,v 1.2 2005/01/27 05:24:11 cozman Exp $
|
||||
//
|
||||
// Revisions:
|
||||
// $Log: LogSink.cpp,v $
|
||||
// Revision 1.2 2005/01/27 05:24:11 cozman
|
||||
// minor documentation update
|
||||
//
|
||||
// Revision 1.1 2005/01/27 03:35:24 cozman
|
||||
// initial import (exceptions,types, and logging,oh my!)
|
||||
//
|
||||
@ -88,9 +91,9 @@ void TextSink::writeMessage(LogLevel level, std::string msg)
|
||||
out_ << pre[static_cast<int>(level)] << msg << std::endl;
|
||||
}
|
||||
|
||||
//HtmlSink
|
||||
//HTMLSink
|
||||
|
||||
HtmlSink::HtmlSink(std::string name, bool dynamic) :
|
||||
HTMLSink::HTMLSink(std::string name, bool dynamic) :
|
||||
LogSink(name,dynamic),
|
||||
out_(std::string(name+".html").c_str())
|
||||
{
|
||||
@ -108,13 +111,13 @@ HtmlSink::HtmlSink(std::string name, bool dynamic) :
|
||||
<< std::endl << "<body>" << std::endl;
|
||||
}
|
||||
|
||||
HtmlSink::~HtmlSink()
|
||||
HTMLSink::~HTMLSink()
|
||||
{
|
||||
out_ << "</body></html>" << std::endl;
|
||||
out_.close();
|
||||
}
|
||||
|
||||
void HtmlSink::writeMessage(LogLevel level, std::string msg)
|
||||
void HTMLSink::writeMessage(LogLevel level, std::string msg)
|
||||
{
|
||||
static char* css[] = {"note","verbose","warning","error","critical"};
|
||||
static char* pre[] = { " NOTE: ",
|
||||
|
Loading…
Reference in New Issue
Block a user