0031642: Visualization - crash in Graphic3d_Structure::SetVisual() on redisplaying...
[occt.git] / src / Message / Message_PrinterSystemLog.hxx
1 // Copyright (c) 2019 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #ifndef _Message_PrinterSystemLog_HeaderFile
15 #define _Message_PrinterSystemLog_HeaderFile
16
17 #include <Message_Printer.hxx>
18 #include <TCollection_AsciiString.hxx>
19
20 DEFINE_STANDARD_HANDLE(Message_PrinterSystemLog, Message_Printer)
21
22 //! Implementation of a message printer associated with system log.
23 //! Implemented for the following systems:
24 //! - Windows, through ReportEventW().
25 //! - Android, through __android_log_write().
26 //! - UNIX/Linux, through syslog().
27 class Message_PrinterSystemLog : public Message_Printer
28 {
29   DEFINE_STANDARD_RTTIEXT(Message_PrinterSystemLog, Message_Printer)
30 public:
31   
32   //! Main constructor.
33   Standard_EXPORT Message_PrinterSystemLog (const TCollection_AsciiString& theEventSourceName,
34                                             const Message_Gravity theTraceLevel = Message_Info);
35
36   //! Destructor.
37   Standard_EXPORT virtual ~Message_PrinterSystemLog();
38
39 protected:
40
41   //! Puts a message to the system log.
42   Standard_EXPORT virtual void send (const TCollection_AsciiString& theString,
43                                      const Message_Gravity theGravity) const Standard_OVERRIDE;
44
45 private:
46
47   TCollection_AsciiString myEventSourceName;
48 #ifdef _WIN32
49   Standard_Address myEventSource;
50 #endif
51
52 };
53
54 #endif // _Message_PrinterSystemLog_HeaderFile