From a15cf65c44d5c224169c32ef5495b68c758134b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 18 May 2014 16:08:14 +0200 Subject: Imported Upstream version 3.3.0.2 --- libcult/documentation/trace/index.xhtml | 102 ++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 libcult/documentation/trace/index.xhtml (limited to 'libcult/documentation/trace/index.xhtml') diff --git a/libcult/documentation/trace/index.xhtml b/libcult/documentation/trace/index.xhtml new file mode 100644 index 0000000..eb00f04 --- /dev/null +++ b/libcult/documentation/trace/index.xhtml @@ -0,0 +1,102 @@ + + + + + + + + + libcult/documentation/trace + + + + + + + + + + + + + + +
+

The libcult trace library provides a general-purpose +program tracing facility. The following code fragment can be found +in libcult/examples/trace:

+ +
+struct foo {};
+
+std::ostream&
+operator<< (std::ostream& o, foo const&)
+{
+  return o << "::foo";
+}
+
+namespace trace = cult::trace;
+
+trace::stream tout ("main", 4);
+
+int
+main ()
+{
+  using trace::record;
+
+  trace::log::instance ().level (9);
+
+  record a ("main", 2);
+  a << "notationally burdensome";
+  tout << a;
+
+  record b ("main", 2);
+  tout << (b << "a bit better, but still burdensome");
+
+  tout << (record ("main", 2) << "this is"
+           << " somewhat"
+           << " twisted but nice to be able to");
+
+  tout << "concise, using default level";
+
+  tout << 9 << "concise, using custom level";
+
+  foo f;
+
+  tout << 3 << f << " " << 5;
+}
+
+ +

Along with the proper implementation, a null implementation is +provided which can be used to completely optimize trace code away. For details +see the +Inlining code away essay.

+
+ +
+

Copyright © 2005-2010 Boris Kolpackov.

+ +
+Permission is granted to copy, distribute and/or modify this document under +the terms of the GNU Free +Documentation License, version 1.2; with no Invariant Sections, no +Front-Cover Texts and no Back-Cover Texts. +
+
+ + + -- cgit v1.2.3