MagickCore 7.0.10
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 "wizard/xml-tree-private.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
 

Macros

#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 IsLogCacheInstantiated (ExceptionInfo *)
 
static WizardBooleanType LoadLogCache (LinkedListInfo *, const char *, const char *, const size_t, ExceptionInfo *)
 
static LinkedListInfoAcquireLogCache (const char *filename, ExceptionInfo *exception)
 
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,...)
 
WizardExport LogEventType SetLogEventMask (const char *events)
 
WizardExport void SetLogFormat (const char *format)
 
WizardExport const char * SetLogName (const char *name)
 

Variables

static const HandlerInfo LogHandlers [32]
 
static const LogMapInfo LogMap []
 
static char log_name [WizardPathExtent] = "Wizard"
 
static LinkedListInfolog_cache = (LinkedListInfo *) NULL
 
static SemaphoreInfolog_semaphore = (SemaphoreInfo *) NULL
 

Macro Definition Documentation

◆ LogFilename

#define LogFilename   "log.xml"

Definition at line 68 of file log.c.

◆ MegabytesToBytes

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

Typedef Documentation

◆ EventInfo

typedef struct _EventInfo EventInfo

◆ HandlerInfo

typedef struct _HandlerInfo HandlerInfo

◆ LogMapInfo

typedef struct _LogMapInfo LogMapInfo

Enumeration Type Documentation

◆ LogHandlerType

Enumerator
UndefinedHandler 
NoHandler 
ConsoleHandler 
StdoutHandler 
StderrHandler 
FileHandler 
DebugHandler 
EventHandler 

Definition at line 73 of file log.c.

Function Documentation

◆ AcquireLogCache()

◆ CloseWizardLog()

◆ DestroyLogElement()

◆ GetLogInfo()

◆ GetLogInfoList()

◆ GetLogList()

◆ GetLogName()

WizardExport const char * GetLogName ( void  )

Definition at line 627 of file log.c.

References log_name.

Referenced by TranslateEvent(), and TranslateFilename().

◆ IsEventLogging()

◆ IsLogCacheInstantiated()

static WizardBooleanType IsLogCacheInstantiated ( ExceptionInfo exception)
static

◆ ListLogInfo()

◆ LoadLogCache()

◆ LogCompare()

static int LogCompare ( const void *  x,
const void *  y 
)
static

Definition at line 548 of file log.c.

References LocaleCompare().

Referenced by GetLogList().

◆ LogComponentGenesis()

◆ LogComponentTerminus()

◆ LogInfoCompare()

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

Definition at line 453 of file log.c.

References LocaleCompare().

Referenced by GetLogInfoList().

◆ LogWizardEvent()

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

Definition at line 1390 of file log.c.

References LogWizardEventList().

Referenced by AcquireFileInfo(), AcquireFileLock(), AcquireUniqueFileResource(), AcquireWizardResource(), AddPathToXMLTree(), AppendFileExtension(), AttachBlob(), AuthenticateKey(), AuthenticateSecretKey(), Base64Decode(), Base64Encode(), CloneSplayTree(), CloseBlob(), ConstructHMAC(), DecipherCBCMode(), DecipherCFBMode(), DecipherCipher(), DecipherCTRMode(), DecipherECBMode(), DecipherOFBMode(), DeleteNodeByValueFromSplayTree(), DeleteNodeFromSplayTree(), DestroyAESInfo(), DestroyAuthenticateInfo(), DestroyBlob(), DestroyBZIPInfo(), DestroyChachaInfo(), DestroyCipherInfo(), DestroyCRC64Info(), DestroyEntropyInfo(), DestroyFileInfo(), DestroyHashInfo(), DestroyHMACInfo(), DestroyKeyInfo(), DestroyKeyringInfo(), DestroyLocaleOptions(), DestroyLZMAInfo(), DestroyMD5Info(), DestroyRandomInfo(), DestroySecretInfo(), DestroySerpentInfo(), DestroySHA1Info(), DestroySHA2224Info(), DestroySHA2256Info(), DestroySHA2384Info(), DestroySHA2512Info(), DestroySHA3Info(), DestroyTwofishInfo(), DestroyXMLTree(), DestroyZIPInfo(), DetachBlob(), EncipherCBCMode(), EncipherCFBMode(), EncipherCipher(), EncipherCTRMode(), EncipherECBMode(), EncipherOFBMode(), EOFBlob(), ExportKeyringKey(), FileToBlob(), FileToString(), FileToStringInfo(), FinalizeCRC64(), FinalizeHash(), FinalizeHMAC(), FinalizeMD5(), FinalizeSHA1(), FinalizeSHA2224(), FinalizeSHA2256(), FinalizeSHA2384(), FinalizeSHA2512(), FinalizeSHA3(), GenerateAuthenticateKey(), GenerateCipherNonce(), GenerateSecretKey(), GenerateSessionKey(), GetAESBlocksize(), GetAuthenticateId(), GetAuthenticateKey(), GetAuthenticateKeyLength(), GetAuthenticatePassphrase(), GetBlobFilename(), GetBlobProperties(), GetBlobSize(), GetBZIPChaos(), GetChachaBlocksize(), 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(), GetLocaleInfoList(), GetLocaleList(), GetLocaleOptions(), GetLocaleValue(), GetLogInfoList(), GetLogList(), GetLZMAChaos(), GetMD5Blocksize(), GetMD5Digest(), GetMD5Digestsize(), GetMimeDescription(), GetMimeInfoList(), GetMimeList(), GetMimeType(), GetNextKeyInSplayTree(), GetNextValueInSplayTree(), GetNextXMLTreeTag(), GetNumberOfNodesInSplayTree(), GetPathComponent(), GetSecretId(), GetSecretKey(), GetSecretKeyLength(), GetSecretPassphrase(), GetSerpentBlocksize(), GetSHA1Blocksize(), GetSHA1Digest(), GetSHA1Digestsize(), GetSHA2224Blocksize(), GetSHA2224Digest(), GetSHA2224Digestsize(), GetSHA2256Blocksize(), GetSHA2256Digest(), GetSHA2256Digestsize(), GetSHA2384Blocksize(), GetSHA2384Digest(), GetSHA2384Digestsize(), GetSHA2512Blocksize(), GetSHA2512Digest(), GetSHA2512Digestsize(), GetSHA3Blocksize(), GetSHA3Digest(), GetSHA3Digestsize(), GetTwofishBlocksize(), GetValueFromSplayTree(), GetXMLTreeAttribute(), GetXMLTreeAttributes(), GetXMLTreeChild(), GetXMLTreeContent(), GetXMLTreeOrdered(), GetXMLTreePath(), GetXMLTreeProcessingInstructions(), GetXMLTreeSibling(), GetXMLTreeTag(), GetZIPChaos(), ImportKeyringKey(), IncreaseBZIP(), IncreaseEntropy(), IncreaseLZMA(), IncreaseZIP(), InitializeCRC64(), InitializeHash(), InitializeHMAC(), InitializeMD5(), InitializeSHA1(), InitializeSHA2224(), InitializeSHA2256(), InitializeSHA2384(), InitializeSHA2512(), InitializeSHA3(), LoadConfigureCache(), LoadLocaleCache(), LoadMimeCache(), OpenBlob(), PrintKeyringProperties(), PruneTagFromXMLTree(), ReadFileChunk(), RegisterWizardSignalHandler(), RelinquishUniqueFileResource(), RelinquishWizardResource(), RemoveNodeByValueFromSplayTree(), RemoveNodeFromSplayTree(), ResetCipherNonce(), ResetHMAC(), ResetSplayTree(), ResetSplayTreeIterator(), RestoreBZIP(), RestoreEntropy(), RestoreLZMA(), RestoreZIP(), SaveEntropyToReservoir(), SetAESKey(), SetAuthenticateId(), SetAuthenticateKeyLength(), SetAuthenticatePassphrase(), SetChachaKey(), SetCipherKey(), SetCipherNonce(), SetKeyInfo(), SetSecretKeyLength(), SetSerpentKey(), SetTwofishKey(), SetXMLTreeAttribute(), SetXMLTreeContent(), SyncBlob(), TellBlob(), ThrowWizardExceptionList(), UpdateCRC64(), UpdateHash(), UpdateHMAC(), WriteFile32Bits(), WriteFile64Bits(), WriteFileChunk(), and XMLTreeInfoToXML().

◆ LogWizardEventList()

◆ ParseLogHandlers()

static LogHandlerType ParseLogHandlers ( const char *  handlers)
static

Definition at line 1672 of file log.c.

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

Referenced by LoadLogCache().

◆ SetLogEventMask()

◆ SetLogFormat()

◆ SetLogName()

WizardExport const char * SetLogName ( const char *  name)

Definition at line 1819 of file log.c.

References CopyWizardString(), log_name, and WizardPathExtent.

◆ TranslateEvent()

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

◆ TranslateFilename()

Variable Documentation

◆ log_cache

◆ log_name

char log_name[WizardPathExtent] = "Wizard"
static

Definition at line 205 of file log.c.

Referenced by GetLogName(), and SetLogName().

◆ log_semaphore

◆ LogHandlers

const HandlerInfo LogHandlers[32]
static

Definition at line 145 of file log.c.

Referenced by ListLogInfo(), and ParseLogHandlers().

◆ LogMap

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

Definition at line 198 of file log.c.

Referenced by AcquireLogCache().