source: trunk/MagicSoft/Mars/mbase/MLogManip.cc@ 5921

Last change on this file since 5921 was 2173, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 4.2 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@uni-sw.gwdg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2001
21!
22!
23\* ======================================================================== */
24
25#include "MLog.h"
26#include "MLogManip.h"
27/*
28// ----------------------------------------------------------------
29// Definitions of the manipulator functions
30// ----------------------------------------------------------------
31
32ostream& __omanip_debug(ostream& lout, int i)
33{
34 //
35 // get the streambuf of the stream
36 // get the pointer to the parent class by casting
37 // set the output level of the logging stream
38 //
39 // Be careful: This manipulator can only be used in MLogging
40 // streams - in other streams SetOutputLevel is a call
41 // of a non existing function
42 //
43 // Be careful 2: The change is valid for everything which is
44 // in the present buffer. This means it can also affect a
45 // part of the stream which is already in the stream but not flushed
46 // to the output device. A flush occures either if you tell a stream
47 // to flush (flush, endl) or if an buffer overflow occures, the
48 // last behaviour could be changed if someone want to have a dynamic
49 // buffer.
50 //
51 MLog *log=(MLog*)lout.rdbuf();
52 log->SetOutputLevel(i);
53 return lout;
54}
55
56ostream& __omanip_device(ostream& lout, int i)
57{
58 //
59 // get the streambuf of the stream
60 // get the pointer to the parent class by casting
61 // set the output device of the logging stream, more than
62 // one output device can be ored together
63 //
64 // Be careful: This manipulator can only be used in MLogging
65 // streams - in other streams SetOutputLevel is a call
66 // of a non existing function
67 //
68 MLog *log=(MLog*)lout.rdbuf();
69 log->SetOutputDevice(i);
70 return lout;
71}
72
73ostream& __omanip_edev(ostream& lout, int i)
74{
75 //
76 // get the streambuf of the stream
77 // get the pointer to the parent class by casting
78 // Enable an output device of the logging stream, it should
79 // be possible to enable more than one output device at the
80 // same time by oring them together
81 //
82 // Be careful: This manipulator can only be used in MLogging
83 // streams - in other streams SetOutputLevel is a call
84 // of a non existing function
85 //
86 MLog *log=(MLog*)lout.rdbuf();
87 log->EnableOutputDevice((MLog::_flags)i);
88 return lout;
89}
90
91ostream& __omanip_ddev(ostream& lout, int i)
92{
93 //
94 // get the streambuf of the stream
95 // get the pointer to the parent class by casting
96 // Disable an output device of the logging stream, it should
97 // be possible to disable more than one output device at the
98 // same time by oring them together
99 //
100 // Be careful: This manipulator can only be used in MLogging
101 // streams - in other streams SetOutputLevel is a call
102 // of a non existing function
103 //
104 MLog *log=(MLog*)lout.rdbuf();
105 log->DisableOutputDevice((MLog::_flags)i);
106 return lout;
107}
108
109ostream& underline(ostream& lout)
110{
111 //
112 // get the streambuf of the stream
113 // get the pointer to the parent class by casting
114 // Disable an output device of the logging stream, it should
115 // be possible to disable more than one output device at the
116 // same time by oring them together
117 //
118 // Be careful: This manipulator can only be used in MLogging
119 // streams - in other streams SetOutputLevel is a call
120 // of a non existing function
121 //
122 MLog *log=(MLog*)lout.rdbuf();
123 log->Underline();
124 return lout;
125}
126*/
Note: See TracBrowser for help on using the repository browser.