Cinder  0.9.1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cinder::log::LoggerFile Class Reference

#include <Log.h>

Inherits cinder::log::Logger.

Inherited by cinder::log::LoggerFileRotating.

Public Member Functions

 LoggerFile (const fs::path &filePath=fs::path(), bool appendToExisting=true)
 
virtual ~LoggerFile ()
 
void write (const Metadata &meta, const std::string &text) override
 
const fs::path & getFilePath () const
 
void setTimestampEnabled (bool enable=true)
 
bool isTimestampEnabled () const
 

Protected Member Functions

fs::path getDefaultLogFilePath () const
 
void ensureDirectoryExists ()
 
void writeDefault (std::ostream &stream, const Metadata &meta, const std::string &text)
 

Protected Attributes

fs::path mFilePath
 
bool mAppend
 
std::ofstream mStream
 

Detailed Description

LoggerFile will write log messages to a specified file.

LoggerFile will write to a specified file, either appending to or overwriting that file at application startup.

Constructor & Destructor Documentation

cinder::log::LoggerFile::LoggerFile ( const fs::path &  filePath = fs::path(),
bool  appendToExisting = true 
)

LoggerFile writes to a single log file. File appending is configurable. If filePath is empty, uses the default ('cinder.log' next to app binary)

cinder::log::LoggerFile::~LoggerFile ( )
virtual

Member Function Documentation

void cinder::log::LoggerFile::write ( const Metadata meta,
const std::string &  text 
)
overridevirtual
const fs::path& cinder::log::LoggerFile::getFilePath ( ) const

Returns the file path targeted by this logger.

fs::path cinder::log::LoggerFile::getDefaultLogFilePath ( ) const
protected
void cinder::log::LoggerFile::ensureDirectoryExists ( )
protected
void cinder::log::Logger::setTimestampEnabled ( bool  enable = true)
inherited
bool cinder::log::Logger::isTimestampEnabled ( ) const
inherited
void cinder::log::Logger::writeDefault ( std::ostream &  stream,
const Metadata meta,
const std::string &  text 
)
protectedinherited

Member Data Documentation

fs::path cinder::log::LoggerFile::mFilePath
protected
bool cinder::log::LoggerFile::mAppend
protected
std::ofstream cinder::log::LoggerFile::mStream
protected

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