log.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. Copyright 1999 ImageMagick Studio LLC, a non-profit organization
  3. dedicated to making software imaging solutions freely available.
  4. You may not use this file except in compliance with the License. You may
  5. obtain a copy of the License at
  6. https://imagemagick.org/script/license.php
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. MagickCore log methods.
  13. */
  14. #ifndef MAGICKCORE_LOG_H
  15. #define MAGICKCORE_LOG_H
  16. #include <stdarg.h>
  17. #include "magick/exception.h"
  18. #if defined(__cplusplus) || defined(c_plusplus)
  19. extern "C" {
  20. #endif
  21. #if !defined(GetMagickModule)
  22. # define GetMagickModule() __FILE__,__func__,(unsigned long) __LINE__
  23. #endif
  24. #define MagickLogFilename "log.xml"
  25. typedef enum
  26. {
  27. UndefinedEvents,
  28. NoEvents = 0x00000,
  29. TraceEvent = 0x00001,
  30. AnnotateEvent = 0x00002,
  31. BlobEvent = 0x00004,
  32. CacheEvent = 0x00008,
  33. CoderEvent = 0x00010,
  34. ConfigureEvent = 0x00020,
  35. DeprecateEvent = 0x00040,
  36. DrawEvent = 0x00080,
  37. ExceptionEvent = 0x00100,
  38. ImageEvent = 0x00200,
  39. LocaleEvent = 0x00400,
  40. ModuleEvent = 0x00800,
  41. PolicyEvent = 0x01000,
  42. ResourceEvent = 0x02000,
  43. TransformEvent = 0x04000,
  44. UserEvent = 0x09000,
  45. WandEvent = 0x10000,
  46. X11Event = 0x20000,
  47. AccelerateEvent = 0x40000,
  48. AllEvents = 0x7fffffff
  49. } LogEventType;
  50. typedef struct _LogInfo
  51. LogInfo;
  52. typedef void
  53. (*MagickLogMethod)(const LogEventType,const char *);
  54. extern const MagickExport LogInfo
  55. **GetLogInfoList(const char *,size_t *,ExceptionInfo *);
  56. extern MagickExport char
  57. **GetLogList(const char *,size_t *,ExceptionInfo *);
  58. extern MagickExport char
  59. *GetLogName(void) magick_attribute((__pure__)),
  60. *SetLogName(const char *);
  61. extern MagickExport LogEventType
  62. GetLogEventMask(void) magick_attribute((__pure__));
  63. extern MagickExport LogEventType
  64. SetLogEventMask(const char *);
  65. extern MagickExport MagickBooleanType
  66. IsEventLogging(void) magick_attribute((__pure__)),
  67. ListLogInfo(FILE *,ExceptionInfo *),
  68. LogComponentGenesis(void),
  69. LogMagickEvent(const LogEventType,const char *,const char *,const size_t,
  70. const char *,...) magick_attribute((__format__ (__printf__,5,6))),
  71. LogMagickEventList(const LogEventType,const char *,const char *,const size_t,
  72. const char *,va_list) magick_attribute((__format__ (__printf__,5,0)));
  73. extern MagickExport void
  74. CloseMagickLog(void),
  75. LogComponentTerminus(void),
  76. SetLogFormat(const char *),
  77. SetLogMethod(MagickLogMethod);
  78. #if defined(__cplusplus) || defined(c_plusplus)
  79. }
  80. #endif
  81. #endif