File: output_log.h

package info (click to toggle)
vcftools 0.1.12%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,680 kB
  • ctags: 1,215
  • sloc: cpp: 12,118; perl: 10,973; ansic: 1,467; pascal: 1,064; makefile: 67; php: 57; sh: 12
file content (46 lines) | stat: -rw-r--r-- 936 bytes parent folder | download | duplicates (6)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
 * log.h
 *
 *  Created on: Nov 11, 2009
 *      Author: Adam Auton
 *      ($Revision: 91 $)
 */

#ifndef LOG_H_
#define LOG_H_

#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <set>
#include <string>
#include <sstream>
#include <unistd.h>

using namespace std;

class output_log
{
public:
	output_log();
	~output_log() {};
	void open(bool stout, bool sterr, const string &filename);
	void close();
	void printLOG(string s);
	void error(string err_msg, int error_code=1);
	void error(string err_msg, double value1, double value2, int error_code=1);
	void warning(string err_msg);
	void one_off_warning(string err_msg);
	static string int2str(int n);
	static string longint2str(long int n);
	static string dbl2str(double n, int prc);
	static string dbl2str_fixed(double n, int prc);
private:
	bool output_to_screen;
	bool output_to_file;
	ofstream LOG;
};

#endif /* LOG_H_ */