Home | History | Annotate | Download | only in MagickCore
      1 /*
      2   Copyright 1999-2016 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.
      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 #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 
     77 extern MagickExport LogEventType
     78   SetLogEventMask(const char *);
     79 
     80 extern MagickExport MagickBooleanType
     81   IsEventLogging(void),
     82   ListLogInfo(FILE *,ExceptionInfo *),
     83   LogMagickEvent(const LogEventType,const char *,const char *,const size_t,
     84     const char *,...)
     85     magick_attribute((__format__ (__printf__,5,6))),
     86   LogMagickEventList(const LogEventType,const char *,const char *,const size_t,
     87     const char *,va_list) magick_attribute((__format__ (__printf__,5,0)));
     88 
     89 extern MagickExport void
     90   CloseMagickLog(void),
     91   SetLogFormat(const char *),
     92   SetLogMethod(MagickLogMethod);
     93 
     94 #if defined(__cplusplus) || defined(c_plusplus)
     95 }
     96 #endif
     97 
     98 #endif
     99