File: output_log.h

package info (click to toggle)
vcftools 0.1.9-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,396 kB
  • sloc: perl: 10,233; cpp: 7,950; pascal: 751; makefile: 60; php: 43; sh: 12
file content (45 lines) | stat: -rw-r--r-- 918 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 * 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>

using namespace std;

class output_log
{
public:
	output_log();
	~output_log() {};
	void open(const string &filename);
	void close();
	void printLOG(string s);
	void error(string err_msg, int error_code=0);
	void error(string err_msg, double value1, double value2, int error_code=0);
	void warning(string err_msg);
	void one_off_warning(string err_msg);
	void set_screen_output(bool do_screen_output);
	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;
	ofstream LOG;
};

#endif /* LOG_H_ */