File: log.h

package info (click to toggle)
bowtie 1.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 14,864 kB
  • ctags: 5,533
  • sloc: cpp: 32,737; perl: 2,084; ansic: 1,241; sh: 1,066; makefile: 344; python: 133
file content (28 lines) | stat: -rw-r--r-- 421 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef LOG_H_
#define LOG_H_

#include <iostream>
#include "threading.h"

class SyncLogger {
public:
	SyncLogger() {
	}

	void msg(const char *s) {
		tthread::lock_guard<MUTEX_T> guard(mutex_m);
		std::cout << s << std::endl;
	}

	void msg(const std::string& s) {
		tthread::lock_guard<MUTEX_T> guard(mutex_m);
		std::cout << s << std::endl;
	}

private:
	MUTEX_T mutex_m;
};

extern SyncLogger glog;

#endif /*LOG_H_*/