13ed852eea50f9d4cd633efb8c2b054b8e33c253cristy/*
27ce65e7125a4e1df1a274ce373c537a9df9c16cdCristy  Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization
33ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  dedicated to making software imaging solutions freely available.
43ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
53ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  You may not use this file except in compliance with the License.
63ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  obtain a copy of the License at
73ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
83ed852eea50f9d4cd633efb8c2b054b8e33c253cristy    http://www.imagemagick.org/script/license.php
93ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
103ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  Unless required by applicable law or agreed to in writing, software
113ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  distributed under the License is distributed on an "AS IS" BASIS,
123ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
133ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  See the License for the specific language governing permissions and
143ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  limitations under the License.
153ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
163ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  MagickCore log methods.
173ed852eea50f9d4cd633efb8c2b054b8e33c253cristy*/
1883bceaa5d7a1196e05c1ccba443f90f4b032fca6Cristy#ifndef MAGICKCORE_LOG_H
1983bceaa5d7a1196e05c1ccba443f90f4b032fca6Cristy#define MAGICKCORE_LOG_H
203ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
216398ec777e91813b64767e25358b7062a7de56cbcristy#include "MagickCore/exception.h"
226398ec777e91813b64767e25358b7062a7de56cbcristy
233ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#if defined(__cplusplus) || defined(c_plusplus)
243ed852eea50f9d4cd633efb8c2b054b8e33c253cristyextern "C" {
253ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#endif
263ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
273ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#if !defined(GetMagickModule)
280ae68f3278fdca81c3e03bda57148cfaed5c206ccristy# define GetMagickModule()  __FILE__,__func__,(unsigned long) __LINE__
293ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#endif
303ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
313ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#define MagickLogFilename  "log.xml"
323ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
333ed852eea50f9d4cd633efb8c2b054b8e33c253cristytypedef enum
343ed852eea50f9d4cd633efb8c2b054b8e33c253cristy{
3568b1497c9b47f095532bd47a17237e9509132ea2cristy  UndefinedEvents = 0x000000,
363ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  NoEvents = 0x00000,
3768b1497c9b47f095532bd47a17237e9509132ea2cristy  AccelerateEvent = 0x00001,
383ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  AnnotateEvent = 0x00002,
393ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  BlobEvent = 0x00004,
403ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  CacheEvent = 0x00008,
413ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  CoderEvent = 0x00010,
423ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  ConfigureEvent = 0x00020,
433ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  DeprecateEvent = 0x00040,
443ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  DrawEvent = 0x00080,
45a322a839a56b8d9fa40751b1906ce2a4780a24d6anthony  ExceptionEvent = 0x00100,   /* Log Errors and Warnings immediately */
467eb1b7a244425a6d1821076a6c3da3f5c3e4b771cristy  ImageEvent = 0x00200,
477eb1b7a244425a6d1821076a6c3da3f5c3e4b771cristy  LocaleEvent = 0x00400,
48a322a839a56b8d9fa40751b1906ce2a4780a24d6anthony  ModuleEvent = 0x00800,      /* Loding of coder and filter modules */
496dcb9b8f58179c62fb386bf2bc02c8ba901dfb15cristy  PixelEvent = 0x01000,
506dcb9b8f58179c62fb386bf2bc02c8ba901dfb15cristy  PolicyEvent = 0x02000,
516dcb9b8f58179c62fb386bf2bc02c8ba901dfb15cristy  ResourceEvent = 0x04000,
5268b1497c9b47f095532bd47a17237e9509132ea2cristy  TraceEvent = 0x08000,
5368b1497c9b47f095532bd47a17237e9509132ea2cristy  TransformEvent = 0x10000,
5468b1497c9b47f095532bd47a17237e9509132ea2cristy  UserEvent = 0x20000,
55a322a839a56b8d9fa40751b1906ce2a4780a24d6anthony  WandEvent = 0x40000,        /* Log MagickWand */
5668b1497c9b47f095532bd47a17237e9509132ea2cristy  X11Event = 0x80000,
57a322a839a56b8d9fa40751b1906ce2a4780a24d6anthony  CommandEvent = 0x100000,    /* Log Command Processing (CLI & Scripts) */
583ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  AllEvents = 0x7fffffff
593ed852eea50f9d4cd633efb8c2b054b8e33c253cristy} LogEventType;
603ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
613ed852eea50f9d4cd633efb8c2b054b8e33c253cristytypedef struct _LogInfo
623ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  LogInfo;
633ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
64e043a5689cca38f2a18a2258071e17ef217563fecristytypedef void
65834a57918ebe6c5e12fb5f97465a9107f805aae5dirk  (*MagickLogMethod)(const LogEventType,const char *);
66834a57918ebe6c5e12fb5f97465a9107f805aae5dirk
673ed852eea50f9d4cd633efb8c2b054b8e33c253cristyextern MagickExport char
68bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy  **GetLogList(const char *,size_t *,ExceptionInfo *);
693ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
703ed852eea50f9d4cd633efb8c2b054b8e33c253cristyextern MagickExport const char
713ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  *GetLogName(void),
723ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  *SetLogName(const char *);
73a322a839a56b8d9fa40751b1906ce2a4780a24d6anthony
743ed852eea50f9d4cd633efb8c2b054b8e33c253cristyextern MagickExport const LogInfo
75bb50337b2a8a16ca7e903cc04ab195ff0fd47ae6cristy  **GetLogInfoList(const char *,size_t *,ExceptionInfo *);
763ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
773ed852eea50f9d4cd633efb8c2b054b8e33c253cristyextern MagickExport LogEventType
783ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  SetLogEventMask(const char *);
793ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
803ed852eea50f9d4cd633efb8c2b054b8e33c253cristyextern MagickExport MagickBooleanType
813ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  IsEventLogging(void),
823ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  ListLogInfo(FILE *,ExceptionInfo *),
835ed838e7a9da2b53119d0f61f728af04a093d4edcristy  LogMagickEvent(const LogEventType,const char *,const char *,const size_t,
845ed838e7a9da2b53119d0f61f728af04a093d4edcristy    const char *,...)
857338053c4a2f46e7eea02ee49303fc36afd2cb38cristy    magick_attribute((__format__ (__printf__,5,6))),
865ed838e7a9da2b53119d0f61f728af04a093d4edcristy  LogMagickEventList(const LogEventType,const char *,const char *,const size_t,
877338053c4a2f46e7eea02ee49303fc36afd2cb38cristy    const char *,va_list) magick_attribute((__format__ (__printf__,5,0)));
883ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
893ed852eea50f9d4cd633efb8c2b054b8e33c253cristyextern MagickExport void
903ed852eea50f9d4cd633efb8c2b054b8e33c253cristy  CloseMagickLog(void),
91834a57918ebe6c5e12fb5f97465a9107f805aae5dirk  SetLogFormat(const char *),
92834a57918ebe6c5e12fb5f97465a9107f805aae5dirk  SetLogMethod(MagickLogMethod);
933ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
943ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#if defined(__cplusplus) || defined(c_plusplus)
953ed852eea50f9d4cd633efb8c2b054b8e33c253cristy}
963ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#endif
973ed852eea50f9d4cd633efb8c2b054b8e33c253cristy
983ed852eea50f9d4cd633efb8c2b054b8e33c253cristy#endif
99