Author: mordante
Date: Wed Apr 9 17:16:15 2008
New Revision: 25706
URL: http://svn.gna.org/viewcvs/wesnoth?rev=25706&view=rev
Log:
Fix and aliasing problem with indent.
The scoped logger now also indents the entire line instead if the word BEGIN.
Modified:
trunk/src/log.cpp
trunk/src/log.hpp
Modified: trunk/src/log.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/log.cpp?rev=25706&r1=25705&r2=25706&view=diff
==============================================================================
--- trunk/src/log.cpp (original)
+++ trunk/src/log.cpp Wed Apr 9 17:16:15 2008
@@ -101,13 +101,13 @@
return buf;
}
-std::ostream &logger::operator()(log_domain const &domain, bool show_names,
bool indent) const
+std::ostream &logger::operator()(log_domain const &domain, bool show_names,
bool do_indent) const
{
logd const &d = log_domains[domain.domain_];
if (severity_ > d.severity_)
return null_ostream;
else {
- if(indent) {
+ if(do_indent) {
for(int i = 0; i != indent; ++i)
std::cerr << " ";
}
@@ -123,10 +123,9 @@
void scope_logger::do_log_entry(log_domain const &domain, const char* str)
{
- output_ = &debug(domain, false);
+ output_ = &debug(domain, false, true);
str_ = str;
ticks_ = SDL_GetTicks();
- do_indent();
(*output_) << "BEGIN: " << str_ << "\n";
++indent;
}
Modified: trunk/src/log.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/log.hpp?rev=25706&r1=25705&r2=25706&view=diff
==============================================================================
--- trunk/src/log.hpp (original)
+++ trunk/src/log.hpp Wed Apr 9 17:16:15 2008
@@ -51,7 +51,7 @@
public:
logger(char const *name, int severity): name_(name),
severity_(severity) {}
std::ostream &operator()(log_domain const &domain,
- bool show_names = true, bool indent = false) const;
+ bool show_names = true, bool do_indent = false) const;
bool dont_log(log_domain const &domain) const
{
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits