GraphLab: Distributed Graph-Parallel API  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
file_logger Class Reference

#include <graphlab/logger/logger.hpp>

List of all members.

Public Member Functions

 file_logger ()
bool set_log_file (std::string file)
 destructor. flushes and closes the current logger file
void set_log_to_console (bool consolelog)
 If consolelog is true, subsequent logger output will be written to stderr.
std::string get_log_file (void)
 Returns the current logger file.
bool get_log_to_console ()
 Returns true if output is being written to stderr.
int get_log_level ()
 Returns the current logger level.
file_loggerstart_stream (int lineloglevel, const char *file, const char *function, int line, bool do_start=true)
template<typename T >
file_loggeroperator<< (T a)
file_loggeroperator<< (const char *a)
file_loggeroperator<< (std::ostream &(*f)(std::ostream &))
void set_log_level (int new_log_level)
void _log (int loglevel, const char *file, const char *function, int line, const char *fmt, va_list arg)
void _logbuf (int loglevel, const char *file, const char *function, int line, const char *buf, int len)
void _lograw (int loglevel, const char *buf, int len)
void stream_flush ()

Detailed Description

logging class. This writes to a file, and/or the system console.

Definition at line 178 of file logger.hpp.


Constructor & Destructor Documentation

file_logger::file_logger ( )

Default constructor. By default, log_to_console is off, there is no logger file, and logger level is set to LOG_WARNING

Definition at line 54 of file logger.cpp.


Member Function Documentation

void file_logger::_log ( int  loglevel,
const char *  file,
const char *  function,
int  line,
const char *  fmt,
va_list  arg 
)

logs the message if loglevel>=OUTPUTLEVEL This function should not be used directly. Use logger()

Parameters:
loglevelType of message
See also:
LOG_DEBUG LOG_INFO LOG_WARNING LOG_ERROR LOG_FATAL
Parameters:
fileFile where the logger call originated
functionFunction where the logger call originated
lineLine number where the logger call originated
fmtprintf format string
argvar args. The parameters that match the format string

Definition at line 124 of file logger.cpp.

bool file_logger::set_log_file ( std::string  file)

destructor. flushes and closes the current logger file

Closes the current logger file if one exists. if 'file' is not an empty string, it will be opened and all subsequent logger output will be written into 'file'. Any existing content of 'file' will be cleared. Return true on success and false on failure.

Definition at line 71 of file logger.cpp.

void file_logger::set_log_level ( int  new_log_level)
inline

Sets the current logger level. All logging commands below the current logger level will not be written.

Definition at line 279 of file logger.hpp.


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