ADBLib  0.5
A simple library for rapid robot code development
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Pages
ADBLib::Log Class Reference

Simple class for a single, independent log file that can be passed around normally. More...

#include <Logger.h>

Collaboration diagram for ADBLib::Log:

Public Member Functions

 Log (string newName, string newFilename)
 Constructor for log. More...
 
 Log ()
 This is never used. It has something to do with tuples. DO NOT USE THIS CONSTRUCTOR. More...
 
void log (string message, logFlag flag=info)
 Log a message with a timestamp and the given flag. More...
 
void flushBuffer ()
 

Private Attributes

vector< string > logBuffer
 
string filename
 
string name
 

Friends

class Logger
 

Detailed Description

Simple class for a single, independent log file that can be passed around normally.

Constructor & Destructor Documentation

ADBLib::Log::Log ( string  newName,
string  newFilename 
)

Constructor for log.

Parameters
newNamethe name of the log as referred to when grabbed by Logger.
newFileNameThe filename for the log file. Do NOT append any file extension, it does it for you.
Note
If on a linux-based system (such as a roboRIO), you need to add "/" to the beginning of the filename.

Here is the call graph for this function:

ADBLib::Log::Log ( )
inline

This is never used. It has something to do with tuples. DO NOT USE THIS CONSTRUCTOR.

Member Function Documentation

void ADBLib::Log::flushBuffer ( )

Flush the log buffer, outputting all messages to file. Log buffers are used to reduce lag from files constantly being opened and closed, because fstream is wierd.

Here is the caller graph for this function:

void ADBLib::Log::log ( string  message,
logFlag  flag = info 
)

Log a message with a timestamp and the given flag.

Parameters
messageThe message to be logged.
flagThis message's flag.

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class Logger
friend

Member Data Documentation

string ADBLib::Log::filename
private
vector<string> ADBLib::Log::logBuffer
private
string ADBLib::Log::name
private

The documentation for this class was generated from the following files: