Skip to content

Commit

Permalink
Debugging..
Browse files Browse the repository at this point in the history
  • Loading branch information
sereni-ty committed Jun 7, 2017
1 parent f3344d3 commit 4254284
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 7 additions & 5 deletions SkyUtilities/Plugin.cpp
Expand Up @@ -33,7 +33,7 @@ namespace SKU {
{
Log(LOGL_INFO, "%s (%s)\n", PLUGIN_NAME, PLUGIN_RELEASE_VERSION_STR);

#ifdef DEBUG
#if defined(DEBUG)
Log(LOGL_INFO, "Waiting for Debugger to attach..");

while (IsDebuggerPresent() == FALSE)
Expand Down Expand Up @@ -227,7 +227,7 @@ namespace SKU {

if (length_read != length)
{
Plugin::Log(LOGL_WARNING, "Plugin: Reading serialized data of record (type: %.*s) failed (size: %d, read: %d). Skipping.",
Log(LOGL_WARNING, "Plugin: Reading serialized data of record (type: %.*s) failed (size: %d, read: %d). Skipping.",
4, reinterpret_cast<char*>(&type), length, length_read);

continue;
Expand All @@ -238,7 +238,7 @@ namespace SKU {

std::get<ISerializeable::idStream>(serialized) = std::move(streamed_data);

Plugin::Log(LOGL_VERBOSE, "Plugin: Deserialization (record: %.*s)..", 4, reinterpret_cast<char *>(&type));
Log(LOGL_VERBOSE, "Plugin: Deserialization (record: %.*s)..", 4, reinterpret_cast<char *>(&type));

GetInstance()->papyrus_event_manager->Deserialize(serialized);
GetInstance()->net->Deserialize(serialized);
Expand Down Expand Up @@ -312,8 +312,10 @@ namespace SKU {
va_list args;
std::string cfmt;

/*if (level > DEBUG)
return;*/
if (level > LOGLEVEL)
{
return;
}

va_start(args, fmt);

Expand Down
6 changes: 3 additions & 3 deletions SkyUtilities/Plugin.h
Expand Up @@ -18,19 +18,19 @@ enum
{
LOGL_CRITICAL = -2,
LOGL_WARNING,
LOGL_INFO,
LOGL_INFO = 0,
LOGL_DETAILED,
LOGL_VERBOSE
};

#define DEBUG LOGL_VERBOSE
#define LOGLEVEL LOGL_VERBOSE

#define PLUGIN_RELEASE_VERSION_MAJOR 0
#define PLUGIN_RELEASE_VERSION_MINOR 1

#define PLUGIN_RELEASE_VERSION_STR "0.1"

#define PLUGIN_VERSION ((PLUGIN_RELEASE_VERSION_MAJOR & 0xFF) << 24) | ((PLUGIN_RELEASE_VERSION_MINOR & 0xFFFFF) << 4) | (DEBUG & 0x0F)
#define PLUGIN_VERSION ((PLUGIN_RELEASE_VERSION_MAJOR & 0xFF) << 24) | (PLUGIN_RELEASE_VERSION_MINOR & 0xFFFFFF)

#define PLUGIN_NAME "SkyUtilities"

Expand Down

0 comments on commit 4254284

Please sign in to comment.