TRF Language Model
|
a definition of a class Log, which can output to the cmd window and the log file simultaneously. In wb-log.cpp, there are a Log variable "lout", which can be directly used just like "cout". For example: More...
#include <iostream>
#include <fstream>
#include <iomanip>
#include <ctime>
#include <cstring>
#include "wb-linux.h"
Go to the source code of this file.
Classes | |
class | wb::ProgressBar |
a progress bar class More... | |
class | wb::Log |
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... | |
Namespaces | |
wb | |
define all the code written by Bin Wang. | |
Macros | |
#define | wbLog_LevelSpace "\t" |
#define | wbLog_OutputSpace(io) for (int i=0; i<m_nLevel; i++) io<<wbLog_LevelSpace; |
#define | wbLog_Output(x) |
#define | lout_variable(x) {wb::lout<<#x" = "<<x<<endl;} |
#define | lout_variable_precent(x, y) {wb::lout<<#x" = "<<x<<" ("<<100.0*(x)/(y)<<"%) /"#y<<"="<<y<<endl;} |
#define | lout_variable_rate(x, y) {wb::lout<<100.0*(x)/(y)<<"%("<<x<<"/"<<y<<")";} |
#define | lout_array(x, n) {wb::lout<<#x"=[ "; for(int i=0; i<n; i++) wb::lout<<x[i]<<" "; wb::lout<<"]"<<endl; } |
#define | lout_error(x) {wb::lout.bOutputCmd()=true; wb::lout<<"[ERROR] "<<x<<endl; exit(0);} |
#define | lout_warning(x) {wb::lout<<"[WARNING] "<<x<<endl;} |
#define | lout_assert(p) {if(!(p)) lout_error("! ("#p")"); } |
#define | precent(x, n) (x)<<"("<<100.0*(x)/(n)<<"%)" |
a definition of a class Log, which can output to the cmd window and the log file simultaneously. In wb-log.cpp, there are a Log variable "lout", which can be directly used just like "cout". For example:
Definition in file wb-log.h.