| 87 | } |
| 88 | |
| 89 | void class_counter::print(const char *flag) { |
| 90 | string buf(2048); |
| 91 | string tmp; |
| 92 | |
| 93 | if (lock_) { |
| 94 | lock_->lock(); |
| 95 | } |
| 96 | |
| 97 | std::map<std::string, long long>::const_iterator it = names_.begin(); |
| 98 | for (; it != names_.end(); ++it) { |
| 99 | if (it != names_.begin()) { |
| 100 | buf.append(", "); |
| 101 | } |
| 102 | tmp.format("[%s: %lld]", it->first.c_str(), it->second); |
| 103 | buf.append(tmp); |
| 104 | } |
| 105 | |
| 106 | if (lock_) { |
| 107 | lock_->unlock(); |
| 108 | } |
| 109 | |
| 110 | if (flag) { |
| 111 | logger("class count(%s)=%s", flag, buf.c_str()); |
| 112 | } else { |
| 113 | logger("class count=%s", buf.c_str()); |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | } // namespace acl |
no test coverage detected