0024644: Draw_Printer - provide the way to control messages gravity filter
[occt.git] / src / Message / Message_Printer.cxx
CommitLineData
b311480e 1// Created on: 2001-01-06
2// Created by: OCC Team
973c2be1 3// Copyright (c) 2001-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 7// This library is free software; you can redistribute it and/or modify it under
8// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 9// by the Free Software Foundation, with special exception defined in the file
10// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11// distribution for complete text of the license and disclaimer of any warranty.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
7fd59977 15
16#include <Message_Printer.ixx>
17
18#include <TCollection_AsciiString.hxx>
19#include <TCollection_ExtendedString.hxx>
20
21//=======================================================================
785a9540 22//function : Constructor
23//purpose :
24//=======================================================================
25
26Message_Printer::Message_Printer()
27: myTraceLevel (Message_Info)
28{
29}
30
31//=======================================================================
7fd59977 32//function : Send
785a9540 33//purpose :
7fd59977 34//=======================================================================
35
36void Message_Printer::Send (const Standard_CString theString,
785a9540 37 const Message_Gravity theGravity,
38 const Standard_Boolean theToOutEol) const
7fd59977 39{
785a9540 40 if (theGravity >= myTraceLevel)
41 {
42 Send (TCollection_ExtendedString (theString), theGravity, theToOutEol);
43 }
7fd59977 44}
45
46//=======================================================================
47//function : Send
785a9540 48//purpose :
7fd59977 49//=======================================================================
50
51void Message_Printer::Send (const TCollection_AsciiString& theString,
785a9540 52 const Message_Gravity theGravity,
53 const Standard_Boolean theToOutEol) const
7fd59977 54{
785a9540 55 if (theGravity >= myTraceLevel)
56 {
57 Send (TCollection_ExtendedString (theString), theGravity, theToOutEol);
58 }
7fd59977 59}