Data Structures | Defines | Typedefs | Enumerations | Functions | Variables

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/version.h"
#include "wizard/xml-tree.h"

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"

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 

Function Documentation

WizardExport void CloseWizardLog ( void   ) 
static void* DestroyLogElement ( void *  log_info  )  [static]
WizardExport const LogInfo* GetLogInfo ( const char *  name,
ExceptionInfo exception 
)
WizardExport const LogInfo** GetLogInfoList ( const char *  pattern,
size_t *  number_preferences,
ExceptionInfo exception 
)
WizardExport char** GetLogList ( const char *  pattern,
size_t *  number_preferences,
ExceptionInfo exception 
)
WizardExport const char* GetLogName ( void   ) 

References log_name.

Referenced by TranslateEvent(), and TranslateFilename().

static WizardBooleanType InitializeLogList ( ExceptionInfo exception  )  [static]
WizardExport WizardBooleanType IsEventLogging ( void   ) 
WizardExport WizardBooleanType ListLogInfo ( FILE *  file,
ExceptionInfo exception 
)
static WizardBooleanType LoadLogList ( const char *  xml,
const char *  filename,
const size_t  depth,
ExceptionInfo exception 
) [static]
static WizardBooleanType LoadLogLists ( const char *  filename,
ExceptionInfo exception 
)
static int LogCompare ( const void *  x,
const void *  y 
) [static]

References LocaleCompare().

Referenced by GetLogList().

WizardExport WizardBooleanType LogComponentGenesis ( void   ) 
WizardExport void LogComponentTerminus ( void   ) 
static int LogInfoCompare ( const void *  x,
const void *  y 
) [static]

References LocaleCompare().

Referenced by GetLogInfoList().

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

References LogWizardEventList().

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

WizardBooleanType LogWizardEventList ( const LogEventType  type,
const char *  module,
const char *  function,
const size_t  line,
const char *  format,
va_list  operands 
)
static LogHandlerType ParseLogHandlers ( const char *  handlers  )  [static]
WizardExport LogEventType SetLogEventMask ( const char *  events  ) 
WizardExport void SetLogFormat ( const char *  format  ) 
WizardExport const char* SetLogName ( const char *  name  ) 
static char* TranslateEvent ( const LogEventType   wizard_unusedtype,
const char *  module,
const char *  function,
const size_t  line,
const char *  domain,
const char *  event 
) [static]
static char* TranslateFilename ( const LogInfo log_info  )  [static]

Variable Documentation

volatile WizardBooleanType instantiate_log = WizardFalse [static]
LinkedListInfo* log_list = (LinkedListInfo *) NULL [static]
char log_name[MaxTextExtent] = "Wizard" [static]

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 }
  }

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" }
  }

Referenced by LoadLogLists().