projects
/
bowtie.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Commit patch to not break on spaces.
[bowtie.git]
/
log.h
1
#ifndef LOG_H_
2
#define LOG_H_
3
4
#include <iostream>
5
#include "threading.h"
6
7
class SyncLogger {
8
public:
9
SyncLogger() {
10
MUTEX_INIT(lock_);
11
}
12
13
void msg(const char *s) {
14
MUTEX_LOCK(lock_);
15
std::cout << s << std::endl;
16
MUTEX_UNLOCK(lock_);
17
}
18
19
void msg(const std::string& s) {
20
MUTEX_LOCK(lock_);
21
std::cout << s << std::endl;
22
MUTEX_UNLOCK(lock_);
23
}
24
25
private:
26
MUTEX_T lock_;
27
};
28
29
extern SyncLogger glog;
30
31
#endif /*LOG_H_*/