File: log_file.cc

package info (click to toggle)
libcwd 1.0.4-1.1
  • links: PTS
  • area: non-free
  • in suites: jessie, jessie-kfreebsd
  • size: 8,136 kB
  • ctags: 10,313
  • sloc: cpp: 23,354; sh: 9,798; ansic: 1,172; makefile: 852; exp: 234; awk: 11
file content (31 lines) | stat: -rw-r--r-- 846 bytes parent folder | download | duplicates (5)
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
//-------------------------------------------------------------------------------
// This block should really be part of custom header files!  Please ignore it
// and read documentation/reference-manual/preparation.html#preparation_step2 instead.
// "sys.h":
#ifndef _GNU_SOURCE		// g++ 3.0 and higher already defines this.
#define _GNU_SOURCE
#endif
#include <libcwd/sys.h>		// This must be the first header file
// "debug.h"
#include <libcwd/debug.h>
//-------------------------------------------------------------------------------

#include <fstream>

int main(void)
{
  Debug( dc::notice.on() );
  Debug( libcw_do.on() );

#ifdef CWDEBUG
  ofstream file;
  file.open("log");
#endif

  // Set the ostream related with libcw_do to `file':  
  Debug( libcw_do.set_ostream(&file) );

  Dout(dc::notice, "Hippopotamus are heavy");

  return 0;
}