File: logit.h

package info (click to toggle)
postal 0.73
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 532 kB
  • sloc: cpp: 4,197; sh: 289; ansic: 258; makefile: 134
file content (35 lines) | stat: -rw-r--r-- 607 bytes parent folder | download | duplicates (8)
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
#ifndef LOGIT_H
#define LOGIT_H

using namespace std;

#include <stdio.h>

#include <string>

class Logit
{
public:
  Logit(const char *filename, bool is_verbose, bool numbered_files, int pid);
  ~Logit();

  int Write(const char *data, size_t len);
  int Write(const string &str) { return Write(str.c_str(), str.size() ); }
  bool verbose() const { return m_verbose; }
  bool reopen();

  Logit(const Logit &l, int pid);
private:
  bool m_verbose;
  FILE *m_fp;
  int m_count;
  int m_numbered_files;
  string m_filename;
  int m_pid;

  Logit(const Logit&);
  Logit & operator=(const Logit&);
};

#endif