#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"
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 LogInfo * | GetLogInfo (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 LinkedListInfo * | log_list = (LinkedListInfo *) NULL |
| static SemaphoreInfo * | log_semaphore = (SemaphoreInfo *) NULL |
| static volatile WizardBooleanType | instantiate_log = WizardFalse |
| #define LogFilename "log.xml" |
Definition at line 66 of file log.c.
Referenced by InitializeLogList().
| #define MegabytesToBytes | ( | value | ) | ((WizardSizeType) (value)*1024*1024) |
Referenced by ListLogInfo().
| typedef struct _EventInfo EventInfo |
| typedef struct _HandlerInfo HandlerInfo |
| typedef struct _LogMapInfo LogMapInfo |
| enum LogHandlerType |
| WizardExport void CloseWizardLog | ( | void | ) |
Definition at line 216 of file log.c.
References AcquireExceptionInfo(), _LogInfo::append, DestroyExceptionInfo(), _LogInfo::file, GetLogInfo(), IsEventLogging(), LockSemaphoreInfo(), log_semaphore, UnlockSemaphoreInfo(), and WizardFalse.
| static void* DestroyLogElement | ( | void * | log_info | ) | [static] |
Definition at line 716 of file log.c.
References _LogInfo::append, DestroyString(), DestroyTimerInfo(), _LogInfo::exempt, _LogInfo::file, _LogInfo::filename, _LogInfo::format, _LogInfo::path, RelinquishWizardMemory(), _LogInfo::timer, and WizardFalse.
Referenced by LogComponentTerminus().
| WizardExport const LogInfo* GetLogInfo | ( | const char * | name, | |
| ExceptionInfo * | exception | |||
| ) |
Definition at line 265 of file log.c.
References GetNextValueInLinkedList(), GetValueFromLinkedList(), GetWizardModule, InitializeLogList(), InsertValueInLinkedList(), instantiate_log, IsLinkedListEmpty(), LocaleCompare(), LockSemaphoreInfo(), log_list, log_semaphore, _LogInfo::name, OptionWarning, RemoveElementByValueFromLinkedList(), ResetLinkedListIterator(), ThrowWizardException(), UnlockSemaphoreInfo(), and WizardFalse.
Referenced by CloseWizardLog(), GetLogInfoList(), GetLogList(), IsEventLogging(), LogWizardEventList(), SetLogEventMask(), SetLogFormat(), and TranslateEvent().
| WizardExport const LogInfo** GetLogInfoList | ( | const char * | pattern, | |
| size_t * | number_preferences, | |||
| ExceptionInfo * | exception | |||
| ) |
Definition at line 350 of file log.c.
References AcquireQuantumMemory(), GetLogInfo(), GetNextValueInLinkedList(), GetNumberOfElementsInLinkedList(), GetWizardModule, GlobExpression(), LockSemaphoreInfo(), log_list, log_semaphore, LogInfoCompare(), LogWizardEvent(), _LogInfo::name, ResetLinkedListIterator(), _LogInfo::stealth, TraceEvent, UnlockSemaphoreInfo(), and WizardFalse.
Referenced by ListLogInfo().
| WizardExport char** GetLogList | ( | const char * | pattern, | |
| size_t * | number_preferences, | |||
| ExceptionInfo * | exception | |||
| ) |
Definition at line 443 of file log.c.
References AcquireQuantumMemory(), ConstantString(), GetLogInfo(), GetNextValueInLinkedList(), GetNumberOfElementsInLinkedList(), GetWizardModule, GlobExpression(), LockSemaphoreInfo(), log_list, log_semaphore, LogCompare(), LogWizardEvent(), _LogInfo::name, ResetLinkedListIterator(), _LogInfo::stealth, TraceEvent, UnlockSemaphoreInfo(), and WizardFalse.
| WizardExport const char* GetLogName | ( | void | ) |
Definition at line 507 of file log.c.
References log_name.
Referenced by TranslateEvent(), and TranslateFilename().
| static WizardBooleanType InitializeLogList | ( | ExceptionInfo * | exception | ) | [static] |
Definition at line 534 of file log.c.
References AcquireSemaphoreInfo(), instantiate_log, LoadLogLists(), LockSemaphoreInfo(), log_list, log_semaphore, LogFilename, UnlockSemaphoreInfo(), WizardFalse, and WizardTrue.
Referenced by GetLogInfo().
| WizardExport WizardBooleanType IsEventLogging | ( | void | ) |
Definition at line 571 of file log.c.
References AcquireExceptionInfo(), DestroyExceptionInfo(), _LogInfo::event_mask, GetLogInfo(), IsLinkedListEmpty(), log_list, NoEvents, WizardFalse, and WizardTrue.
Referenced by AddChildToXMLTree(), CloseWizardLog(), GetBlobInfo(), LogWizardEventList(), NewHashmap(), NewSplayTree(), NewXMLTreeTag(), and WizardsToolkitGenesis().
| WizardExport WizardBooleanType ListLogInfo | ( | FILE * | file, | |
| ExceptionInfo * | exception | |||
| ) |
Definition at line 611 of file log.c.
References FormatWizardSize(), _LogInfo::generations, GetLogInfoList(), LocaleCompare(), MegabytesToBytes, _LogInfo::path, RelinquishWizardMemory(), WizardFalse, and WizardTrue.
| static WizardBooleanType LoadLogList | ( | const char * | xml, | |
| const char * | filename, | |||
| const size_t | depth, | |||
| ExceptionInfo * | exception | |||
| ) | [static] |
Definition at line 1281 of file log.c.
References AcquireAlignedMemory(), AcquireString(), AcquireTimerInfo(), AppendValueToLinkedList(), ConcatenateWizardString(), ConfigureError, ConstantString(), CopyWizardString(), DestroyString(), DirectorySeparator, _LogInfo::event_mask, _LogInfo::exempt, _LogInfo::filename, FileToString(), _LogInfo::format, _LogInfo::generations, GetPathComponent(), GetWizardModule, GetWizardToken(), _LogInfo::handler_mask, HeadPath, _LogInfo::limit, LocaleCompare(), LocaleNCompare(), log_list, NewLinkedList(), ParseLogHandlers(), ParseWizardOption(), _LogInfo::path, RelinquishWizardMemory(), ResetWizardMemory(), ResourceError, ResourceFatalError, _LogInfo::signature, StringToUnsignedLong(), ThrowFatalException, ThrowWizardException(), _LogInfo::timer, WizardFalse, WizardLogEventOptions, WizardSignature, and WizardTrue.
Referenced by LoadLogLists().
| static WizardBooleanType LoadLogLists | ( | const char * | filename, | |
| ExceptionInfo * | exception | |||
| ) |
Definition at line 1526 of file log.c.
References AcquireAlignedMemory(), AcquireTimerInfo(), AppendValueToLinkedList(), ConstantString(), DestroyConfigureOptions(), _LogMapInfo::event_mask, _LogInfo::event_mask, _LogInfo::exempt, FileError, _LogMapInfo::filename, _LogInfo::filename, _LogMapInfo::format, _LogInfo::format, GetConfigureOptions(), GetNextValueInLinkedList(), GetStringInfoDatum(), GetStringInfoPath(), GetWizardModule, _LogMapInfo::handler_mask, _LogInfo::handler_mask, LoadLogList(), log_list, LogMap, _LogInfo::name, NewLinkedList(), _LogInfo::path, ResetWizardMemory(), ResourceError, _LogInfo::signature, ThrowFileException, ThrowWizardException(), _LogInfo::timer, WizardFalse, WizardSignature, and WizardTrue.
Referenced by InitializeLogList().
| static int LogCompare | ( | const void * | x, | |
| const void * | y | |||
| ) | [static] |
| WizardExport WizardBooleanType LogComponentGenesis | ( | void | ) |
Definition at line 691 of file log.c.
References AcquireSemaphoreInfo(), log_semaphore, and WizardTrue.
Referenced by WizardsToolkitGenesis().
| WizardExport void LogComponentTerminus | ( | void | ) |
Definition at line 744 of file log.c.
References AcquireSemaphoreInfo(), DestroyLinkedList(), DestroyLogElement(), DestroySemaphoreInfo(), instantiate_log, LockSemaphoreInfo(), log_list, log_semaphore, UnlockSemaphoreInfo(), and WizardFalse.
Referenced by WizardsToolkitTerminus().
| static int LogInfoCompare | ( | const void * | x, | |
| const void * | y | |||
| ) | [static] |
| WizardBooleanType LogWizardEvent | ( | const LogEventType | type, | |
| const char * | module, | |||
| const char * | function, | |||
| const size_t | line, | |||
| const char * | format, | |||
| ... | ||||
| ) |
Definition at line 1236 of file log.c.
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(), 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(), 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(), 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(), 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 | |||
| ) |
Definition at line 1112 of file log.c.
References AcquireExceptionInfo(), _LogInfo::append, ConsoleHandler, ContinueTimer(), DebugHandler, DestroyExceptionInfo(), _LogInfo::event_mask, EventHandler, _LogInfo::file, FileHandler, fileno, _LogInfo::generation, GetLogInfo(), _LogInfo::handler_mask, IsAccessible(), IsEventLogging(), _LogInfo::limit, LockSemaphoreInfo(), log_semaphore, NTReportEvent(), RelinquishWizardMemory(), StderrHandler, StdoutHandler, _LogInfo::timer, TranslateEvent(), TranslateFilename(), UnlockSemaphoreInfo(), vsnprintf, WizardFalse, WizardLogEventOptions, WizardOpenStream(), WizardOptionToMnemonic(), and WizardTrue.
Referenced by LogWizardEvent().
| static LogHandlerType ParseLogHandlers | ( | const char * | handlers | ) | [static] |
Definition at line 1622 of file log.c.
References LocaleNCompare(), LogHandlers, _HandlerInfo::name, NoHandler, and UndefinedHandler.
Referenced by LoadLogList().
| WizardExport LogEventType SetLogEventMask | ( | const char * | events | ) |
Definition at line 1681 of file log.c.
References AcquireExceptionInfo(), DestroyExceptionInfo(), _LogInfo::event_mask, GetLogInfo(), GetValueFromLinkedList(), LockSemaphoreInfo(), log_list, log_semaphore, ParseWizardOption(), UndefinedEvents, UnlockSemaphoreInfo(), WizardLogEventOptions, and WizardTrue.
Referenced by WizardsToolkitGenesis().
| WizardExport void SetLogFormat | ( | const char * | format | ) |
Definition at line 1727 of file log.c.
References AcquireExceptionInfo(), ConstantString(), DestroyExceptionInfo(), DestroyString(), _LogInfo::format, GetLogInfo(), LockSemaphoreInfo(), log_semaphore, and UnlockSemaphoreInfo().
| WizardExport const char* SetLogName | ( | const char * | name | ) |
Definition at line 1769 of file log.c.
References CopyWizardString(), and log_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] |
Definition at line 789 of file log.c.
References AcquireExceptionInfo(), AcquireString(), CopyWizardString(), DestroyExceptionInfo(), DirectorySeparator, _LogInfo::format, FormatWizardString(), FormatWizardTime(), _LogInfo::generation, _LogInfo::generations, GetClientName(), GetElapsedTime(), GetLogInfo(), GetLogName(), getpid, GetUserTime(), GetWizardThreadSignature(), LocaleCompare(), ResizeQuantumMemory(), _LogInfo::timer, and WizardLibVersionText.
Referenced by LogWizardEventList().
| static char* TranslateFilename | ( | const LogInfo * | log_info | ) | [static] |
Definition at line 1011 of file log.c.
References AcquireString(), CopyWizardString(), _LogInfo::filename, FormatWizardString(), _LogInfo::generation, _LogInfo::generations, GetClientName(), GetLogName(), getpid, ResizeQuantumMemory(), and WizardLibVersionText.
Referenced by LogWizardEventList().
volatile WizardBooleanType instantiate_log = WizardFalse [static] |
Definition at line 186 of file log.c.
Referenced by GetLogInfo(), InitializeLogList(), and LogComponentTerminus().
LinkedListInfo* log_list = (LinkedListInfo *) NULL [static] |
Definition at line 180 of file log.c.
Referenced by GetLogInfo(), GetLogInfoList(), GetLogList(), InitializeLogList(), IsEventLogging(), LoadLogList(), LoadLogLists(), LogComponentTerminus(), and SetLogEventMask().
char log_name[MaxTextExtent] = "Wizard" [static] |
Definition at line 177 of file log.c.
Referenced by GetLogName(), and SetLogName().
SemaphoreInfo* log_semaphore = (SemaphoreInfo *) NULL [static] |
Definition at line 183 of file log.c.
Referenced by CloseWizardLog(), GetLogInfo(), GetLogInfoList(), GetLogList(), InitializeLogList(), LogComponentGenesis(), LogComponentTerminus(), LogWizardEventList(), SetLogEventMask(), and SetLogFormat().
const HandlerInfo LogHandlers[] [static] |
{
{ "console", ConsoleHandler },
{ "debug", DebugHandler },
{ "event", EventHandler },
{ "file", FileHandler },
{ "none", NoHandler },
{ "stderr", StderrHandler },
{ "stdout", StdoutHandler },
{ (char *) NULL, UndefinedHandler }
}
Definition at line 141 of file log.c.
Referenced by ParseLogHandlers().
const LogMapInfo LogMap[] [static] |
{
{ NoEvents, ConsoleHandler, "Magick-%d.log",
"%t %r %u %v %d %c[%p]: %m/%f/%l/%d\n %e" }
}
Definition at line 170 of file log.c.
Referenced by LoadLogLists().
1.6.2-20100208