Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:16

0001 // Copyright (c) 2019 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _Message_PrinterSystemLog_HeaderFile
0015 #define _Message_PrinterSystemLog_HeaderFile
0016 
0017 #include <Message_Printer.hxx>
0018 #include <TCollection_AsciiString.hxx>
0019 
0020 DEFINE_STANDARD_HANDLE(Message_PrinterSystemLog, Message_Printer)
0021 
0022 //! Implementation of a message printer associated with system log.
0023 //! Implemented for the following systems:
0024 //! - Windows, through ReportEventW().
0025 //! - Android, through __android_log_write().
0026 //! - UNIX/Linux, through syslog().
0027 class Message_PrinterSystemLog : public Message_Printer
0028 {
0029   DEFINE_STANDARD_RTTIEXT(Message_PrinterSystemLog, Message_Printer)
0030 public:
0031   
0032   //! Main constructor.
0033   Standard_EXPORT Message_PrinterSystemLog (const TCollection_AsciiString& theEventSourceName,
0034                                             const Message_Gravity theTraceLevel = Message_Info);
0035 
0036   //! Destructor.
0037   Standard_EXPORT virtual ~Message_PrinterSystemLog();
0038 
0039 protected:
0040 
0041   //! Puts a message to the system log.
0042   Standard_EXPORT virtual void send (const TCollection_AsciiString& theString,
0043                                      const Message_Gravity theGravity) const Standard_OVERRIDE;
0044 
0045 private:
0046 
0047   TCollection_AsciiString myEventSourceName;
0048 #ifdef _WIN32
0049   Standard_Address myEventSource;
0050 #endif
0051 
0052 };
0053 
0054 #endif // _Message_PrinterSystemLog_HeaderFile