MagickCore  7.0.3
log.h
Go to the documentation of this file.
1 /*
2  Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
3  dedicated to making software imaging solutions freely available.
4 
5  You may not use this file except in compliance with the License. You may
6  obtain a copy of the License at
7 
8  https://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 #include "MagickCore/exception.h"
22 
23 #if defined(__cplusplus) || defined(c_plusplus)
24 extern "C" {
25 #endif
26 
27 #if !defined(GetMagickModule)
28 # define GetMagickModule() __FILE__,__func__,(unsigned long) __LINE__
29 #endif
30 
31 #define MagickLogFilename "log.xml"
32 
33 typedef enum
34 {
35  UndefinedEvents = 0x000000,
36  NoEvents = 0x00000,
37  AccelerateEvent = 0x00001,
38  AnnotateEvent = 0x00002,
39  BlobEvent = 0x00004,
40  CacheEvent = 0x00008,
41  CoderEvent = 0x00010,
42  ConfigureEvent = 0x00020,
43  DeprecateEvent = 0x00040,
44  DrawEvent = 0x00080,
45  ExceptionEvent = 0x00100, /* Log Errors and Warnings immediately */
46  ImageEvent = 0x00200,
47  LocaleEvent = 0x00400,
48  ModuleEvent = 0x00800, /* Loding of coder and filter modules */
49  PixelEvent = 0x01000,
50  PolicyEvent = 0x02000,
51  ResourceEvent = 0x04000,
52  TraceEvent = 0x08000,
53  TransformEvent = 0x10000,
54  UserEvent = 0x20000,
55  WandEvent = 0x40000, /* Log MagickWand */
56  X11Event = 0x80000,
57  CommandEvent = 0x100000, /* Log Command Processing (CLI & Scripts) */
58  AllEvents = 0x7fffffff
59 } LogEventType;
60 
61 typedef struct _LogInfo
62  LogInfo;
63 
64 typedef void
65  (*MagickLogMethod)(const LogEventType,const char *);
66 
67 extern MagickExport char
68  **GetLogList(const char *,size_t *,ExceptionInfo *);
69 
70 extern MagickExport const char
71  *GetLogName(void),
72  *SetLogName(const char *);
73 
74 extern MagickExport const LogInfo
75  **GetLogInfoList(const char *,size_t *,ExceptionInfo *);
76 
78  SetLogEventMask(const char *);
79 
81  IsEventLogging(void) magick_attribute((__pure__)),
82  ListLogInfo(FILE *,ExceptionInfo *),
83  LogMagickEvent(const LogEventType,const char *,const char *,const size_t,
84  const char *,...) magick_attribute((__format__ (__printf__,5,6))),
85  LogMagickEventList(const LogEventType,const char *,const char *,const size_t,
86  const char *,va_list) magick_attribute((__format__ (__printf__,5,0)));
87 
88 extern MagickExport void
89  CloseMagickLog(void),
90  SetLogFormat(const char *),
92 
93 #if defined(__cplusplus) || defined(c_plusplus)
94 }
95 #endif
96 
97 #endif
Definition: log.h:39
MagickExport MagickBooleanType LogMagickEventList(const LogEventType type, const char *module, const char *function, const size_t line, const char *format, va_list operands)
Definition: log.c:1269
Definition: log.h:56
void(* MagickLogMethod)(const LogEventType, const char *)
Definition: log.h:65
Definition: log.h:44
LogEventType
Definition: log.h:33
MagickExport MagickBooleanType ListLogInfo(FILE *file, ExceptionInfo *exception)
Definition: log.c:749
MagickExport LogEventType SetLogEventMask(const char *events)
Definition: log.c:1737
Definition: log.h:58
Definition: log.h:52
#define magick_attribute(x)
MagickBooleanType
Definition: magick-type.h:158
MagickExport const LogInfo ** GetLogInfoList(const char *pattern, size_t *number_preferences, ExceptionInfo *exception)
Definition: log.c:479
MagickExport char ** GetLogList(const char *pattern, size_t *number_preferences, ExceptionInfo *exception)
Definition: log.c:572
MagickExport void SetLogFormat(const char *format)
Definition: log.c:1784
Definition: log.c:109
MagickExport const char * GetLogName(void)
Definition: log.c:636
MagickExport MagickBooleanType IsEventLogging(void)
Definition: log.c:720
MagickExport void CloseMagickLog(void)
Definition: log.c:351
MagickExport MagickBooleanType LogMagickEvent(const LogEventType type, const char *module, const char *function, const size_t line, const char *format,...)
Definition: log.c:1397
Definition: log.h:40
Definition: log.h:46
MagickExport void SetLogMethod(MagickLogMethod method)
Definition: log.c:1825
Definition: log.h:49
Definition: log.h:54
Definition: log.h:55
MagickExport const char * SetLogName(const char *name)
Definition: log.c:1868
Definition: log.h:36
#define MagickExport
Definition: log.h:41