# log.h

Go to the documentation of this file.

    00001 /*
    00002   Copyright 1999-2008 ImageMagick Studio LLC, a non-profit organization
    00003   dedicated to making software imaging solutions freely available.
    00004
    00005   You may not use this file except in compliance with the License.
    00006   obtain a copy of the License at
    00007
    00008     http://www.wizards-toolkit.org/script/license.php
    00009
    00010   Unless required by applicable law or agreed to in writing, software
    00011   distributed under the License is distributed on an "AS IS" BASIS,
    00012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    00013   See the License for the specific language governing permissions and
    00014   limitations under the License.
    00015
    00016   Wizard's Toolkit log methods.
    00017 */
    00018 #ifndef _WIZARDS_TOOLKIT_LOG_H
    00019 #define _WIZARDS_TOOLKIT_LOG_H
    00020
    00021 #if defined(__cplusplus) || defined(c_plusplus)
    00022 extern "C" {
    00023 #endif
    00024
    00025 #include <stdarg.h>
    00026 #include "wizard/exception.h"
    00027 #include "wizard/timer.h"
    00028
    00029 #if !defined(GetUnadornedModuleName)
    00030 # if (((defined(__cplusplus) || defined(c_plusplus)) && defined(HAS_CPP__func__)) || \
    00031       (!(defined(__cplusplus) || defined(c_plusplus)) && defined(HAS_C__func__)))
    00032 #  define GetUnadornedModuleName() (__func__)
    00033 # elif defined(_VISUALC_) && defined(__FUNCTION__)
    00034 #  define GetUnadornedModuleName() (__FUNCTION__)
    00035 # else
    00036 #  define GetUnadornedModuleName() ("unknown")
    00037 # endif
    00038 #endif
    00039 #if !defined(GetWizardModule)
    00040 # define GetWizardModule()  \
    00041   __FILE__,GetUnadornedModuleName(),(unsigned long) __LINE__
    00042 #endif
    00043
    00044 #define WizardLogFilename  "log.xml"
    00045
    00046 typedef enum
    00047 {
    00048   UndefinedEvents,
    00049   NoEvents = 0x0000,
    00050   TraceEvent = 0x0001,
    00051   AnnotateEvent = 0x0002,
    00052   BlobEvent = 0x0004,
    00053   CacheEvent = 0x0008,
    00054   CoderEvent = 0x0010,
    00055   ConfigureEvent = 0x0020,
    00056   DeprecateEvent = 0x0040,
    00057   ExceptionEvent = 0x0080,
    00058   LocaleEvent = 0x0100,
    00059   ModuleEvent = 0x0200,
    00060   ResourceEvent = 0x0400,
    00061   TransformEvent = 0x0800,
    00062   WarningEvent = 0x1000,
    00063   UserEvent = 0x2000,
    00064   AllEvents = 0x7fffffff
    00065 } LogEventType;
    00066
    00067 typedef struct _LogInfo
    00068   LogInfo;
    00069
    00070 extern WizardExport char
    00071   **GetLogList(const char *,unsigned long *,ExceptionInfo *);
    00072
    00073 extern WizardExport const LogInfo
    00074   *GetLogInfo(const char *,ExceptionInfo *),
    00075   **GetLogInfoList(const char *,unsigned long *,ExceptionInfo *);
    00076
    00077 extern WizardExport LogEventType
    00078   SetLogEventMask(const char *);
    00079
    00080 extern WizardExport WizardBooleanType
    00081   IsEventLogging(void),
    00082   ListLogInfo(FILE *,ExceptionInfo *),
    00083   LogWizardEvent(const LogEventType,const char *,const char *,
    00084     const unsigned long,const char *,...)
    00085     wizard_attribute((format (printf,5,6))),
    00086   LogWizardEventList(const LogEventType,const char *,const char *,
    00087     const unsigned long,const char *,va_list)
    00088     wizard_attribute((format (printf,5,0)));
    00089
    00090 extern WizardExport void
    00091   CloseWizardLog(void),
    00092   DestroyLogList(void),
    00093   SetLogFormat(const char *),
    00094   SetLogPreamble(const char *);
    00095
    00096 #if defined(__cplusplus) || defined(c_plusplus)
    00097 }
    00098 #endif
    00099
    00100 #endif