Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
UFileLogger Class Reference
Inheritance diagram for UFileLogger:
Inheritance graph
[legend]

Public Member Functions

virtual ~UFileLogger ()
 

Protected Member Functions

 UFileLogger (const std::string &fileName, bool append)
 
- Protected Member Functions inherited from ULogger
void _flush ()
 
 ULogger ()
 
virtual ~ULogger ()
 

Private Member Functions

virtual void _write (const char *msg, va_list arg)
 
virtual void _writeStr (const char *msg)
 

Private Attributes

std::string bufferedMsgs_
 
std::string fileName_
 the file name More...
 
FILE * fout_
 

Friends

class ULogger
 

Additional Inherited Members

- Public Types inherited from ULogger
enum  Level {
  kDebug, kInfo, kWarning, kError,
  kFatal
}
 
enum  Type { kTypeNoLog, kTypeConsole, kTypeFile }
 
- Static Public Member Functions inherited from ULogger
static ULogger::Level eventLevel ()
 
static ULogger::Level exitLevel ()
 
static void flush ()
 
static int getTime (std::string &timeStr)
 
static bool isBuffered ()
 
static bool isPrintColored ()
 
static bool isPrintEndLine ()
 
static bool isPrintLevel ()
 
static bool isPrintTime ()
 
static bool isPrintWhere ()
 
static bool isPrintWhereFullPath ()
 
static ULogger::Level level ()
 
static void reset ()
 
static void setBuffered (bool buffered)
 
static void setEventLevel (ULogger::Level eventSentLevel)
 
static void setExitLevel (ULogger::Level exitLevel)
 
static void setLevel (ULogger::Level level)
 
static void setPrintColored (bool printColored)
 
static void setPrintEndline (bool printEndline)
 
static void setPrintLevel (bool printLevel)
 
static void setPrintTime (bool printTime)
 
static void setPrintWhere (bool printWhere)
 
static void setPrintWhereFullPath (bool printWhereFullPath)
 
static void setType (Type type, const std::string &fileName=kDefaultLogFileName, bool append=true)
 
static Type type ()
 
static void write (const char *msg,...)
 
static void write (ULogger::Level level, const char *file, int line, const char *function, const char *msg,...)
 
- Static Public Attributes inherited from ULogger
static const std::string kDefaultLogFileName = "./ULog.txt"
 
- Static Protected Member Functions inherited from ULogger
static ULoggergetInstance ()
 
- Static Protected Attributes inherited from ULogger
static bool append_ = true
 
static std::string logFileName_
 

Detailed Description

This class is used to write logs in a file. This class cannot be directly used, use ULogger::setType() to file type to print in a file and use macro UDEBUG(), UINFO()... to print messages.

See also
ULogger

Definition at line 105 of file ULogger.cpp.

Constructor & Destructor Documentation

virtual UFileLogger::~UFileLogger ( )
inlinevirtual

Definition at line 108 of file ULogger.cpp.

UFileLogger::UFileLogger ( const std::string &  fileName,
bool  append 
)
inlineprotected

The UFileLogger constructor.

Parameters
fileNamethe file name
appendif true append logs in the file, ortherwise it overrides the file.

Definition at line 131 of file ULogger.cpp.

Member Function Documentation

virtual void UFileLogger::_write ( const char *  msg,
va_list  arg 
)
inlineprivatevirtual

Reimplemented from ULogger.

Definition at line 154 of file ULogger.cpp.

virtual void UFileLogger::_writeStr ( const char *  msg)
inlineprivatevirtual

Reimplemented from ULogger.

Definition at line 161 of file ULogger.cpp.

Friends And Related Function Documentation

friend class ULogger
friend

Only the Logger can create inherited loggers according to the Abstract factory patterns.

Definition at line 122 of file ULogger.cpp.

Member Data Documentation

std::string UFileLogger::bufferedMsgs_
private

Definition at line 172 of file ULogger.cpp.

std::string UFileLogger::fileName_
private

the file name

Definition at line 170 of file ULogger.cpp.

FILE* UFileLogger::fout_
private

Definition at line 171 of file ULogger.cpp.


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


find_object_2d
Author(s): Mathieu Labbe
autogenerated on Thu Jun 6 2019 19:22:26