| 1 | /* | 
|---|
| 2 | * synergy -- mouse and keyboard sharing utility | 
|---|
| 3 | * Copyright (C) 2002 Chris Schoeneman | 
|---|
| 4 | * | 
|---|
| 5 | * This package is free software; you can redistribute it and/or | 
|---|
| 6 | * modify it under the terms of the GNU General Public License | 
|---|
| 7 | * found in the file COPYING that should have accompanied this file. | 
|---|
| 8 | * | 
|---|
| 9 | * This package is distributed in the hope that it will be useful, | 
|---|
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 12 | * GNU General Public License for more details. | 
|---|
| 13 | */ | 
|---|
| 14 |  | 
|---|
| 15 | #ifndef IARCHLOG_H | 
|---|
| 16 | #define IARCHLOG_H | 
|---|
| 17 |  | 
|---|
| 18 | #include "IInterface.h" | 
|---|
| 19 |  | 
|---|
| 20 | //! Interface for architecture dependent logging | 
|---|
| 21 | /*! | 
|---|
| 22 | This interface defines the logging operations required by | 
|---|
| 23 | synergy.  Each architecture must implement this interface. | 
|---|
| 24 | */ | 
|---|
| 25 | class IArchLog : public IInterface { | 
|---|
| 26 | public: | 
|---|
| 27 | //! Log levels | 
|---|
| 28 | /*! | 
|---|
| 29 | The logging priority levels in order of highest to lowest priority. | 
|---|
| 30 | */ | 
|---|
| 31 | enum ELevel { | 
|---|
| 32 | kERROR,                 //!< For serious or fatal errors | 
|---|
| 33 | kWARNING,               //!< For minor errors and warnings | 
|---|
| 34 | kNOTE,                  //!< For messages about notable events | 
|---|
| 35 | kINFO,                  //!< For informational messages | 
|---|
| 36 | kDEBUG                  //!< For debugging messages | 
|---|
| 37 | }; | 
|---|
| 38 |  | 
|---|
| 39 | //! @name manipulators | 
|---|
| 40 | //@{ | 
|---|
| 41 |  | 
|---|
| 42 | //! Open the log | 
|---|
| 43 | /*! | 
|---|
| 44 | Opens the log for writing.  The log must be opened before being | 
|---|
| 45 | written to. | 
|---|
| 46 | */ | 
|---|
| 47 | virtual void            openLog(const char* name) = 0; | 
|---|
| 48 |  | 
|---|
| 49 | //! Close the log | 
|---|
| 50 | /*! | 
|---|
| 51 | Close the log. | 
|---|
| 52 | */ | 
|---|
| 53 | virtual void            closeLog() = 0; | 
|---|
| 54 |  | 
|---|
| 55 | //! Show the log | 
|---|
| 56 | /*! | 
|---|
| 57 | Causes the log to become visible.  This generally only makes sense | 
|---|
| 58 | for a log in a graphical user interface.  Other implementations | 
|---|
| 59 | will do nothing.  Iff \p showIfEmpty is \c false then the implementation | 
|---|
| 60 | may optionally only show the log if it's not empty. | 
|---|
| 61 | */ | 
|---|
| 62 | virtual void            showLog(bool showIfEmpty) = 0; | 
|---|
| 63 |  | 
|---|
| 64 | //! Write to the log | 
|---|
| 65 | /*! | 
|---|
| 66 | Writes the given string to the log with the given level. | 
|---|
| 67 | */ | 
|---|
| 68 | virtual void            writeLog(ELevel, const char*) = 0; | 
|---|
| 69 |  | 
|---|
| 70 | //@} | 
|---|
| 71 | }; | 
|---|
| 72 |  | 
|---|
| 73 | #endif | 
|---|