|
TRF Language Model
|
this class can output to the cmd window and log files simultaneously. In wb-log.cpp, there are a Log variable "lout", which can be directly used just like "cout". For example: More...
#include <wb-log.h>
Public Member Functions | |
| Log () | |
| constructor More... | |
| ~Log () | |
| destructor More... | |
| void | ReFile (const char *path, bool bNew=true) |
| relocate the log file. The defualt log file is "program name".log More... | |
| bool & | bOutputCmd () |
| if output to the cmd window More... | |
| bool & | bOutputLog () |
| if output to the log file More... | |
| template<typename T > | |
| Log & | output (T *pArray, int n, const char *pgap=" ") |
| output an array More... | |
| void | LevelDown () |
| level down More... | |
| void | LevelUp () |
| level up More... | |
| void | Progress (long long n=-1, bool bInit=false, long long total=100, const char *head="") |
| progress bar More... | |
| void | Progress (FILE *fp, bool bInit=false, const char *head="") |
| progress bar for file More... | |
| Log & | operator<< (ostream &(*op)(ostream &)) |
| output. More... | |
| Log & | operator<< (int x) |
| Log & | operator<< (short x) |
| Log & | operator<< (long x) |
| Log & | operator<< (long long x) |
| Log & | operator<< (unsigned int x) |
| Log & | operator<< (unsigned short x) |
| Log & | operator<< (unsigned long x) |
| Log & | operator<< (float x) |
| Log & | operator<< (double x) |
| Log & | operator<< (char x) |
| Log & | operator<< (const char *x) |
| Log & | operator<< (const void *x) |
| Log & | operator<< (bool x) |
| Log & | operator<< (string &x) |
Protected Attributes | |
| ofstream | m_fileLog |
| log file stream More... | |
| bool | m_bOutputLog |
| if output to the log file More... | |
| bool | m_bOutputCmd |
| if output to the cmd window More... | |
| short | m_nLevel |
| output level More... | |
| ProgressBar | m_bar |
| the build-in progerss bar. More... | |
this class can output to the cmd window and log files simultaneously. In wb-log.cpp, there are a Log variable "lout", which can be directly used just like "cout". For example:
| wb::Log::Log | ( | ) |
constructor
Definition at line 24 of file wb-log.cpp.
| wb::Log::~Log | ( | ) |
destructor
Definition at line 56 of file wb-log.cpp.
| bool & wb::Log::bOutputCmd | ( | ) |
| bool & wb::Log::bOutputLog | ( | ) |
| void wb::Log::LevelDown | ( | ) |
| void wb::Log::LevelUp | ( | ) |
| Log & wb::Log::operator<< | ( | ostream &(*)(ostream &) | op | ) |
output.
Definition at line 100 of file wb-log.cpp.
| Log & wb::Log::operator<< | ( | int | x | ) |
Definition at line 101 of file wb-log.cpp.
| Log & wb::Log::operator<< | ( | short | x | ) |
Definition at line 102 of file wb-log.cpp.
| Log & wb::Log::operator<< | ( | long | x | ) |
Definition at line 103 of file wb-log.cpp.
| Log & wb::Log::operator<< | ( | long long | x | ) |
Definition at line 104 of file wb-log.cpp.
| Log & wb::Log::operator<< | ( | unsigned int | x | ) |
Definition at line 105 of file wb-log.cpp.
| Log & wb::Log::operator<< | ( | unsigned short | x | ) |
Definition at line 106 of file wb-log.cpp.
| Log & wb::Log::operator<< | ( | unsigned long | x | ) |
Definition at line 107 of file wb-log.cpp.
| Log & wb::Log::operator<< | ( | float | x | ) |
Definition at line 108 of file wb-log.cpp.
| Log & wb::Log::operator<< | ( | double | x | ) |
Definition at line 109 of file wb-log.cpp.
| Log & wb::Log::operator<< | ( | char | x | ) |
Definition at line 110 of file wb-log.cpp.
| Log & wb::Log::operator<< | ( | const char * | x | ) |
Definition at line 111 of file wb-log.cpp.
| Log & wb::Log::operator<< | ( | const void * | x | ) |
Definition at line 120 of file wb-log.cpp.
| Log & wb::Log::operator<< | ( | bool | x | ) |
Definition at line 129 of file wb-log.cpp.
| Log & wb::Log::operator<< | ( | string & | x | ) |
Definition at line 138 of file wb-log.cpp.
| void wb::Log::Progress | ( | long long | n = -1, |
| bool | bInit = false, |
||
| long long | total = 100, |
||
| const char * | head = "" |
||
| ) |
progress bar
Definition at line 146 of file wb-log.cpp.
| void wb::Log::Progress | ( | FILE * | fp, |
| bool | bInit = false, |
||
| const char * | head = "" |
||
| ) |
progress bar for file
Definition at line 155 of file wb-log.cpp.
| void wb::Log::ReFile | ( | const char * | path, |
| bool | bNew = true |
||
| ) |
relocate the log file. The defualt log file is "program name".log
���¶�λlog������ļ���bNew�Ƿ����´����ļ���������Ѵ����ļ����ݣ�
| [in] | path | the file path |
| [in] | bNew | setting true will clean the log file. |
Definition at line 68 of file wb-log.cpp.
|
protected |
|
protected |
|
protected |