blob: b32f9970574c2ad7cd52e058197f214da9acdbed [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001/*
cristy1454be72011-12-19 01:52:48 +00002 Copyright 1999-2012 ImageMagick Studio LLC, a non-profit organization
cristy3ed852e2009-09-05 21:47:34 +00003 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)
22extern "C" {
23#endif
24
25#include <stdarg.h>
cristy4c08aed2011-07-01 19:47:50 +000026#include "MagickCore/exception.h"
cristy3ed852e2009-09-05 21:47:34 +000027
28#if !defined(GetMagickModule)
cristy0ae68f32010-06-04 00:40:15 +000029# define GetMagickModule() __FILE__,__func__,(unsigned long) __LINE__
cristy3ed852e2009-09-05 21:47:34 +000030#endif
31
32#define MagickLogFilename "log.xml"
33
34typedef enum
35{
cristy68b14972011-10-26 14:54:58 +000036 UndefinedEvents = 0x000000,
cristy3ed852e2009-09-05 21:47:34 +000037 NoEvents = 0x00000,
cristy68b14972011-10-26 14:54:58 +000038 AccelerateEvent = 0x00001,
cristy3ed852e2009-09-05 21:47:34 +000039 AnnotateEvent = 0x00002,
40 BlobEvent = 0x00004,
41 CacheEvent = 0x00008,
42 CoderEvent = 0x00010,
43 ConfigureEvent = 0x00020,
44 DeprecateEvent = 0x00040,
45 DrawEvent = 0x00080,
46 ExceptionEvent = 0x00100,
cristy7eb1b7a2010-06-26 15:47:49 +000047 ImageEvent = 0x00200,
48 LocaleEvent = 0x00400,
49 ModuleEvent = 0x00800,
cristy6dcb9b82011-10-23 23:21:25 +000050 PixelEvent = 0x01000,
51 PolicyEvent = 0x02000,
52 ResourceEvent = 0x04000,
cristy68b14972011-10-26 14:54:58 +000053 TraceEvent = 0x08000,
54 TransformEvent = 0x10000,
55 UserEvent = 0x20000,
56 WandEvent = 0x40000,
57 X11Event = 0x80000,
cristy3ed852e2009-09-05 21:47:34 +000058 AllEvents = 0x7fffffff
59} LogEventType;
60
61typedef struct _LogInfo
62 LogInfo;
63
64extern MagickExport char
cristybb503372010-05-27 20:51:26 +000065 **GetLogList(const char *,size_t *,ExceptionInfo *);
cristy3ed852e2009-09-05 21:47:34 +000066
67extern MagickExport const char
68 *GetLogName(void),
69 *SetLogName(const char *);
70
71extern MagickExport const LogInfo
cristybb503372010-05-27 20:51:26 +000072 **GetLogInfoList(const char *,size_t *,ExceptionInfo *);
cristy3ed852e2009-09-05 21:47:34 +000073
74extern MagickExport LogEventType
75 SetLogEventMask(const char *);
76
77extern MagickExport MagickBooleanType
78 IsEventLogging(void),
79 ListLogInfo(FILE *,ExceptionInfo *),
cristy5ed838e2010-05-31 00:05:35 +000080 LogMagickEvent(const LogEventType,const char *,const char *,const size_t,
81 const char *,...)
cristy73380532012-02-18 20:26:28 +000082 magick_attribute((__format__ (__printf__,5,6))),
cristy5ed838e2010-05-31 00:05:35 +000083 LogMagickEventList(const LogEventType,const char *,const char *,const size_t,
cristy73380532012-02-18 20:26:28 +000084 const char *,va_list) magick_attribute((__format__ (__printf__,5,0)));
cristy3ed852e2009-09-05 21:47:34 +000085
86extern MagickExport void
87 CloseMagickLog(void),
cristy3ed852e2009-09-05 21:47:34 +000088 SetLogFormat(const char *);
89
90#if defined(__cplusplus) || defined(c_plusplus)
91}
92#endif
93
94#endif