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