WizardsToolkit  1.0.7
log.c File Reference
#include "wizard/studio.h"
#include "wizard/blob.h"
#include "wizard/client.h"
#include "wizard/configure.h"
#include "wizard/exception.h"
#include "wizard/exception-private.h"
#include "wizard/hashmap.h"
#include "wizard/log.h"
#include "wizard/memory_.h"
#include "wizard/option.h"
#include "wizard/semaphore.h"
#include "wizard/string_.h"
#include "wizard/string-private.h"
#include "wizard/thread_.h"
#include "wizard/thread-private.h"
#include "wizard/timer.h"
#include "wizard/token.h"
#include "wizard/utility.h"
#include "wizard/utility-private.h"
#include "wizard/version.h"
#include "wizard/xml-tree.h"
Include dependency graph for log.c:

Go to the source code of this file.

Data Structures

struct  _EventInfo
struct  _HandlerInfo
struct  _LogInfo
struct  _LogMapInfo

Defines

#define LogFilename   "log.xml"
#define MegabytesToBytes(value)   ((WizardSizeType) (value)*1024*1024)

Typedefs

typedef struct _EventInfo EventInfo
typedef struct _HandlerInfo HandlerInfo
typedef struct _LogMapInfo LogMapInfo

Enumerations

enum  LogHandlerType {
  UndefinedHandler = 0x0000, NoHandler = 0x0000, ConsoleHandler = 0x0001, StdoutHandler = 0x0002,
  StderrHandler = 0x0004, FileHandler = 0x0008, DebugHandler = 0x0010, EventHandler = 0x0020
}

Functions

static LogHandlerType ParseLogHandlers (const char *)
static WizardBooleanType InitializeLogList (ExceptionInfo *)
static WizardBooleanType LoadLogLists (const char *, ExceptionInfo *)
WizardExport void CloseWizardLog (void)
WizardExport const LogInfoGetLogInfo (const char *name, ExceptionInfo *exception)
static int LogInfoCompare (const void *x, const void *y)
WizardExport const LogInfo ** GetLogInfoList (const char *pattern, size_t *number_preferences, ExceptionInfo *exception)
static int LogCompare (const void *x, const void *y)
WizardExport char ** GetLogList (const char *pattern, size_t *number_preferences, ExceptionInfo *exception)
WizardExport const char * GetLogName (void)
WizardExport WizardBooleanType IsEventLogging (void)
WizardExport WizardBooleanType ListLogInfo (FILE *file, ExceptionInfo *exception)
WizardExport WizardBooleanType LogComponentGenesis (void)
static void * DestroyLogElement (void *log_info)
WizardExport void LogComponentTerminus (void)
static char * TranslateEvent (const LogEventType wizard_unused(type), const char *module, const char *function, const size_t line, const char *domain, const char *event)
static char * TranslateFilename (const LogInfo *log_info)
WizardBooleanType LogWizardEventList (const LogEventType type, const char *module, const char *function, const size_t line, const char *format, va_list operands)
WizardBooleanType LogWizardEvent (const LogEventType type, const char *module, const char *function, const size_t line, const char *format,...)
static WizardBooleanType LoadLogList (const char *xml, const char *filename, const size_t depth, ExceptionInfo *exception)
WizardExport LogEventType SetLogEventMask (const char *events)
WizardExport void SetLogFormat (const char *format)
WizardExport const char * SetLogName (const char *name)

Variables

static const HandlerInfo LogHandlers []
static const LogMapInfo LogMap []
static char log_name [MaxTextExtent] = "Wizard"
static LinkedListInfolog_list = (LinkedListInfo *) NULL
static SemaphoreInfolog_semaphore = (SemaphoreInfo *) NULL
static volatile WizardBooleanType instantiate_log = WizardFalse

Define Documentation

#define LogFilename   "log.xml"

Definition at line 67 of file log.c.

Referenced by InitializeLogList().

#define MegabytesToBytes (   value)    ((WizardSizeType) (value)*1024*1024)

Referenced by ListLogInfo().


Typedef Documentation

typedef struct _EventInfo EventInfo
typedef struct _HandlerInfo HandlerInfo
typedef struct _LogMapInfo LogMapInfo

Enumeration Type Documentation

Enumerator:
UndefinedHandler 
NoHandler 
ConsoleHandler 
StdoutHandler 
StderrHandler 
FileHandler 
DebugHandler 
EventHandler 

Definition at line 72 of file log.c.


Function Documentation

static void* DestroyLogElement ( void *  log_info) [static]
WizardExport const char* GetLogName ( void  )

Definition at line 508 of file log.c.

References log_name.

Referenced by TranslateEvent(), and TranslateFilename().

static WizardBooleanType InitializeLogList ( ExceptionInfo exception) [static]
static int LogCompare ( const void *  x,
const void *  y 
) [static]

Definition at line 429 of file log.c.

References LocaleCompare().

Referenced by GetLogList().

WizardExport WizardBooleanType LogComponentGenesis ( void  )

Definition at line 692 of file log.c.

References AcquireSemaphoreInfo(), log_semaphore, and WizardTrue.

Referenced by WizardsToolkitGenesis().

static int LogInfoCompare ( const void *  x,
const void *  y 
) [static]

Definition at line 334 of file log.c.

References LocaleCompare().

Referenced by GetLogInfoList().

WizardBooleanType LogWizardEvent ( const LogEventType  type,
const char *  module,
const char *  function,
const size_t  line,
const char *  format,
  ... 
)

Definition at line 1237 of file log.c.

References LogWizardEventList().

Referenced by DestroyAESInfo(), GetAESBlocksize(), SetAESKey(), AuthenticateKey(), DestroyAuthenticateInfo(), GenerateAuthenticateKey(), GetAuthenticateId(), GetAuthenticateKey(), GetAuthenticateKeyLength(), GetAuthenticatePassphrase(), SetAuthenticateId(), SetAuthenticateKeyLength(), SetAuthenticatePassphrase(), AttachBlob(), CloseBlob(), DestroyBlob(), DetachBlob(), EOFBlob(), FileToBlob(), GetBlobFilename(), GetBlobSize(), GetBlobProperties(), OpenBlob(), SyncBlob(), TellBlob(), DestroyBZIPInfo(), GetBZIPChaos(), IncreaseBZIP(), RestoreBZIP(), DecipherCBCMode(), DecipherCFBMode(), DecipherCipher(), DecipherCTRMode(), DecipherECBMode(), DecipherOFBMode(), DestroyCipherInfo(), EncipherCBCMode(), EncipherCFBMode(), EncipherCipher(), EncipherCTRMode(), EncipherECBMode(), EncipherOFBMode(), GetCipherBlocksize(), GenerateCipherNonce(), GetCipherNonce(), ResetCipherNonce(), SetCipherNonce(), SetCipherKey(), DestroyConfigureOptions(), GetConfigureInfoList(), GetConfigureList(), GetConfigureOptions(), GetConfigurePaths(), GetConfigureValue(), LoadConfigureList(), DestroyCRC64Info(), FinalizeCRC64(), GetCRC64Blocksize(), GetCRC64CyclicRedundancyCheck(), GetCRC64Digest(), GetCRC64Digestsize(), InitializeCRC64(), UpdateCRC64(), DestroyEntropyInfo(), GetEntropyChaos(), IncreaseEntropy(), RestoreEntropy(), ThrowWizardExceptionList(), AcquireFileLock(), AcquireFileInfo(), DestroyFileInfo(), GetFileDescriptor(), GetFilePath(), GetFileProperties(), ReadFileChunk(), WriteFileChunk(), WriteFile32Bits(), WriteFile64Bits(), DestroyHashInfo(), FinalizeHash(), GetHashBlocksize(), GetHashDigest(), GetHashDigestsize(), GetHashHexDigest(), InitializeHash(), UpdateHash(), AppendValueToLinkedList(), ClearLinkedList(), DestroyHashmap(), DestroyLinkedList(), GetLastValueInLinkedList(), GetNextKeyInHashmap(), GetNextValueInHashmap(), GetNextValueInLinkedList(), GetNumberOfEntriesInHashmap(), GetNumberOfElementsInLinkedList(), GetValueFromHashmap(), GetValueFromLinkedList(), InsertValueInLinkedList(), InsertValueInSortedLinkedList(), IsHashmapEmpty(), IsLinkedListEmpty(), LinkedListToArray(), PutEntryInHashmap(), RemoveElementByValueFromLinkedList(), RemoveElementFromLinkedList(), RemoveEntryFromHashmap(), RemoveLastElementFromLinkedList(), ResetHashmapIterator(), ResetLinkedListIterator(), ConstructHMAC(), DestroyHMACInfo(), FinalizeHMAC(), GetHMACDigest(), GetHMACDigestsize(), InitializeHMAC(), ResetHMAC(), UpdateHMAC(), DestroyKeyInfo(), GenerateSessionKey(), GetKeyInfo(), SetKeyInfo(), DestroyKeyringInfo(), ExportKeyringKey(), GetKeyringKey(), GetKeyringNonce(), ImportKeyringKey(), PrintKeyringProperties(), GetLogInfoList(), GetLogList(), GetLZMAChaos(), DestroyLZMAInfo(), IncreaseLZMA(), RestoreLZMA(), DestroyMD5Info(), FinalizeMD5(), GetMD5Blocksize(), GetMD5Digest(), GetMD5Digestsize(), InitializeMD5(), GetMimeInfoList(), GetMimeList(), GetMimeDescription(), GetMimeType(), LoadMimeList(), DestroyRandomInfo(), GetEntropyFromReservoir(), SaveEntropyToReservoir(), AcquireUniqueFileResource(), AcquireWizardResource(), RelinquishWizardResource(), RelinquishUniqueFileResource(), AuthenticateSecretKey(), DestroySecretInfo(), GenerateSecretKey(), GetSecretId(), GetSecretKey(), GetSecretKeyLength(), GetSecretPassphrase(), SetSecretKeyLength(), DestroySerpentInfo(), GetSerpentBlocksize(), SetSerpentKey(), DestroySHA1Info(), FinalizeSHA1(), GetSHA1Blocksize(), GetSHA1Digest(), GetSHA1Digestsize(), InitializeSHA1(), DestroySHA224Info(), FinalizeSHA224(), GetSHA224Blocksize(), GetSHA224Digest(), GetSHA224Digestsize(), InitializeSHA224(), DestroySHA256Info(), FinalizeSHA256(), GetSHA256Blocksize(), GetSHA256Digest(), GetSHA256Digestsize(), InitializeSHA256(), DestroySHA384Info(), FinalizeSHA384(), GetSHA384Blocksize(), GetSHA384Digest(), GetSHA384Digestsize(), InitializeSHA384(), DestroySHA512Info(), FinalizeSHA512(), GetSHA512Blocksize(), GetSHA512Digest(), GetSHA512Digestsize(), InitializeSHA512(), CloneSplayTree(), DeleteNodeByValueFromSplayTree(), DeleteNodeFromSplayTree(), GetNextKeyInSplayTree(), GetNextValueInSplayTree(), GetValueFromSplayTree(), GetNumberOfNodesInSplayTree(), RemoveNodeByValueFromSplayTree(), RemoveNodeFromSplayTree(), ResetSplayTree(), ResetSplayTreeIterator(), CloneString(), CloneStringInfo(), CompareStringInfo(), ConcatenateStringInfo(), DestroyStringInfo(), FileToString(), FileToStringInfo(), GetStringInfoCRC(), HexStringToStringInfo(), PrintStringInfo(), ResetStringInfo(), SetStringInfo(), SetStringInfoDatum(), SetStringInfoLength(), SetStringInfoPath(), SplitStringInfo(), StringToStringInfo(), DestroyTwofishInfo(), GetTwofishBlocksize(), SetTwofishKey(), AppendFileExtension(), Base64Decode(), Base64Encode(), GetPathComponent(), RegisterWizardSignalHandler(), AddPathToXMLTree(), DestroyXMLTree(), GetNextXMLTreeTag(), GetXMLTreeAttribute(), GetXMLTreeAttributes(), GetXMLTreeChild(), GetXMLTreeContent(), GetXMLTreeOrdered(), GetXMLTreePath(), GetXMLTreeProcessingInstructions(), GetXMLTreeSibling(), GetXMLTreeTag(), PruneTagFromXMLTree(), SetXMLTreeAttribute(), SetXMLTreeContent(), XMLTreeInfoToXML(), GetZIPChaos(), DestroyZIPInfo(), IncreaseZIP(), and RestoreZIP().

static LogHandlerType ParseLogHandlers ( const char *  handlers) [static]

Definition at line 1623 of file log.c.

References NoHandler, LogHandlers, _HandlerInfo::name, LocaleNCompare(), and UndefinedHandler.

Referenced by LoadLogList().

WizardExport void SetLogFormat ( const char *  format)
WizardExport const char* SetLogName ( const char *  name)

Definition at line 1770 of file log.c.

References CopyWizardString(), log_name, and MaxTextExtent.

static char* TranslateEvent ( const LogEventType   wizard_unusedtype,
const char *  module,
const char *  function,
const size_t  line,
const char *  domain,
const char *  event 
) [static]

Variable Documentation

volatile WizardBooleanType instantiate_log = WizardFalse [static]

Definition at line 187 of file log.c.

Referenced by GetLogInfo(), InitializeLogList(), and LogComponentTerminus().

char log_name[MaxTextExtent] = "Wizard" [static]

Definition at line 178 of file log.c.

Referenced by GetLogName(), and SetLogName().

const HandlerInfo LogHandlers[] [static]
Initial value:
  {
    { "console", ConsoleHandler },
    { "debug", DebugHandler },
    { "event", EventHandler },
    { "file", FileHandler },
    { "none", NoHandler },
    { "stderr", StderrHandler },
    { "stdout", StdoutHandler },
    { (char *) NULL, UndefinedHandler }
  }

Definition at line 142 of file log.c.

Referenced by ParseLogHandlers().

const LogMapInfo LogMap[] [static]
Initial value:
  {
    { NoEvents, ConsoleHandler, "Magick-%d.log",
      "%t %r %u %v %d %c[%p]: %m/%f/%l/%d\n  %e" }
  }

Definition at line 171 of file log.c.

Referenced by LoadLogLists().