File: writing_intro.dox

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 (37 lines) | stat: -rw-r--r-- 1,474 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
32
33
34
35
36
37
/*!
\defgroup book_writing_intro Writing Debug Output: Introduction
\ingroup book_writing
*/
/*!
\page page_writing_into
\ingroup book_writing_intro

\section section_writing_into_introduction Introduction

Libcwd is an <code>ostream</code> oriented debug output facility.&nbsp;
The class libcwd::debug_ct represents a single <code>ostream</code>.&nbsp;

Libcwd defines and internally uses only one object of that class, called a \ref group_debug_object "debug object",
being libcwd::libcw_do.&nbsp;

Debug output is written using \ref page_why_macro "macros" (\ref Dout and \ref DoutFatal),
both of which are defined to use libcwd::libcw_do.&nbsp;
More general macros exist (\ref LibcwDout and \ref LibcwDoutFatal) that allow you
to use a different (\ref chapter_custom_do "custom") debug object.

\ref Dout and \ref DoutFatal take two arguments: the first argument is used to specify
\ref group_debug_channels "debug channels" and \ref group_control_flags "control flags"
while the second argument should be a series of objects seperated by <code><<</code>
that you want to write to the <code>ostream</code>.

For example,

\code
Dout(dc::notice|blank_label_cf|flush_cf, "Total count: " << count << "; Average: " << average);
\endcode

In this example <code>dc::notice</code> is one of the \ref group_default_dc "predefined" debug channels.&nbsp;
Debug channels are intended to control the amount of output of your application:
you can switch the channels on and off.

*/