|
|
|
@ -21,9 +21,8 @@ namespace qbrowserlib { |
|
|
|
|
if (!_debug || !_close) return; |
|
|
|
|
++_level; |
|
|
|
|
std::stringstream ss; |
|
|
|
|
// init(ss);
|
|
|
|
|
indent(ss)<<"\\ "<<_name; |
|
|
|
|
// std::clog<<close(ss).str()<<std::endl;
|
|
|
|
|
close(init(std::clog)<<ss.str())<<std::endl; |
|
|
|
|
if (!_dialog) _dialog = new LogDialog; |
|
|
|
|
_dialog->append(*this, ss.str()); |
|
|
|
|
} |
|
|
|
@ -31,9 +30,8 @@ namespace qbrowserlib { |
|
|
|
|
Log::~Log() throw() { |
|
|
|
|
if (!_debug || !_close) return; |
|
|
|
|
std::stringstream ss; |
|
|
|
|
// init(ss);
|
|
|
|
|
indent(ss)<<"/ "<<_name; |
|
|
|
|
// std::clog<<close(ss).str()<<std::endl;
|
|
|
|
|
close(init(std::clog)<<ss.str())<<std::endl; |
|
|
|
|
--_level; |
|
|
|
|
if (!_dialog) _dialog = new LogDialog; |
|
|
|
|
_dialog->append(*this, ss.str()); |
|
|
|
@ -47,7 +45,7 @@ namespace qbrowserlib { |
|
|
|
|
_dialog->show(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::stringstream& Log::init(std::stringstream& ss) { |
|
|
|
|
std::ostream& Log::init(std::ostream& ss) { |
|
|
|
|
if (_addr) |
|
|
|
|
ss<<std::hex<<std::setw(15)<<_addr<<": "<<std::dec; |
|
|
|
|
else |
|
|
|
@ -55,12 +53,12 @@ namespace qbrowserlib { |
|
|
|
|
return ss; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::stringstream& Log::indent(std::stringstream& ss) { |
|
|
|
|
std::ostream& Log::indent(std::ostream& ss) { |
|
|
|
|
ss<<std::setw(2+_level)<<std::setfill(' '); |
|
|
|
|
return ss; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::stringstream& Log::close(std::stringstream& ss) { |
|
|
|
|
std::ostream& Log::close(std::ostream& ss) { |
|
|
|
|
ss<<" ("<<_file<<':'<<_line<<')'; |
|
|
|
|
return ss; |
|
|
|
|
} |
|
|
|
|