Visualization Library 2.0.0

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vl::StandardLog Class Reference

The StandardLog class outputs the log messages on the stdout device and optionally also on a specified file. More...

#include <Log.hpp>

+ Inheritance diagram for vl::StandardLog:

Public Member Functions

void setLogFile (const String &file)
 
const StringlogFile () const
 
- Public Member Functions inherited from vl::Log
 Log ()
 
Logoperator<< (ELogLevel log_level)
 
Logoperator<< (const String &str)
 
Logoperator<< (const std::string &v)
 
Logoperator<< (const void *v)
 
Logoperator<< (const char *v)
 
Logoperator<< (char v)
 
Logoperator<< (unsigned char v)
 
Logoperator<< (short v)
 
Logoperator<< (unsigned short v)
 
Logoperator<< (int v)
 
Logoperator<< (unsigned int v)
 
Logoperator<< (long v)
 
Logoperator<< (unsigned long v)
 
Logoperator<< (long long v)
 
Logoperator<< (unsigned long long v)
 
Logoperator<< (double v)
 
Logoperator<< (float v)
 
- Public Member Functions inherited from vl::Object
 Object ()
 Constructor. More...
 
 Object (const Object &other)
 Copy constructor: copies the name, ref count mutex and user data. More...
 
Objectoperator= (const Object &other)
 Copy operator: copies the object's name, ref count mutex and user data. More...
 
const std::string & objectName () const
 The name of the object, by default set to the object's class name. More...
 
void setObjectName (const char *name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setObjectName (const std::string &name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setRefCountMutex (IMutex *mutex)
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
IMutexrefCountMutex ()
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
const IMutexrefCountMutex () const
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
int referenceCount () const
 Returns the number of references of an object. More...
 
void incReference () const
 Increments the reference count of an object. More...
 
void decReference ()
 Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More...
 
void setAutomaticDelete (bool autodel_on)
 If set to true the Object is deleted when its reference count reaches 0. More...
 
bool automaticDelete () const
 If set to true the Object is deleted when its reference count reaches 0. More...
 
template<class T >
T * as ()
 Casts an Object to the specified class. More...
 
template<class T >
const T * as () const
 Casts an Object to the specified class. More...
 

Protected Member Functions

virtual void printImplementation (ELogLevel level, const String &message)
 
- Protected Member Functions inherited from vl::Object
virtual ~Object ()
 

Protected Attributes

String mLogFile
 
std::ofstream mFile
 
- Protected Attributes inherited from vl::Log
ELogLevel mLogLevel
 
- Protected Attributes inherited from vl::Object
std::string mObjectName
 
IMutexmRefCountMutex
 
int mReferenceCount
 
bool mAutomaticDelete
 

Additional Inherited Members

- Static Public Member Functions inherited from vl::Log
static void setLogMutex (IMutex *mutex)
 The mutex used to synchronize concurrent calls to the log functions. More...
 
static IMutexlogMutex ()
 The mutex used to synchronize concurrent calls to the log functions. More...
 
static void notify (const String &message)
 Important application message for the user. More...
 
static void print (const String &message)
 Application message for the user. More...
 
static void debug (const String &message)
 Use this function to provide extra information useful to investigate and solve problems. More...
 
static void warning (const String &message)
 Use this function to provide information about situations that might lead to errors or loss of data. More...
 
static void error (const String &message)
 Use this function to provide information about run-time errors: file not found, out of memory, OpenGL version too old etc. More...
 
static void bug (const String &message)
 Use this function to provide information about programming errors: wrong parameter initialization, division by zero, imminent crash, inconsistent program state etc. More...
 

Detailed Description

The StandardLog class outputs the log messages on the stdout device and optionally also on a specified file.

Definition at line 228 of file Log.hpp.

Member Function Documentation

◆ logFile()

const String& vl::StandardLog::logFile ( ) const
inline

Definition at line 234 of file Log.hpp.

◆ printImplementation()

void StandardLog::printImplementation ( ELogLevel  level,
const String message 
)
protectedvirtual

Implements vl::Log.

Definition at line 214 of file Log.cpp.

References vl::String::empty(), and vl::String::toStdString().

◆ setLogFile()

void StandardLog::setLogFile ( const String file)

Definition at line 203 of file Log.cpp.

References vl::String::empty(), and vl::String::toStdString().

Referenced by vl::VisualizationLibrary::isCoreInitialized().

Member Data Documentation

◆ mFile

std::ofstream vl::StandardLog::mFile
protected

Definition at line 239 of file Log.hpp.

◆ mLogFile

String vl::StandardLog::mLogFile
protected

Definition at line 238 of file Log.hpp.


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