mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-19 08:11:30 +00:00
static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID]
enum LogCategory
This commit is contained in:
parent
489f24a80a
commit
2e397b1383
@ -20,6 +20,7 @@
|
|||||||
#include "eqemu_logsys.h"
|
#include "eqemu_logsys.h"
|
||||||
#include "string_util.h"
|
#include "string_util.h"
|
||||||
#include "rulesys.h"
|
#include "rulesys.h"
|
||||||
|
#include "platform.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
@ -71,10 +72,26 @@ static const char* TypeNames[EQEmuLogSys::MaxLogID] = {
|
|||||||
"Save",
|
"Save",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* If you add to this, make sure you update LogCategory in eqemu_logsys.h */
|
||||||
static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = {
|
static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = {
|
||||||
|
"Zone",
|
||||||
|
"World",
|
||||||
|
"UCS",
|
||||||
|
"QueryServer",
|
||||||
|
"WebInterface",
|
||||||
|
"AA",
|
||||||
|
"Doors",
|
||||||
|
"Guild",
|
||||||
|
"Inventory",
|
||||||
"Netcode",
|
"Netcode",
|
||||||
"Guilds",
|
"Object",
|
||||||
"Rules",
|
"Rules",
|
||||||
|
"Skills",
|
||||||
|
"Spawns",
|
||||||
|
"Spells",
|
||||||
|
"Tasks",
|
||||||
|
"Trading",
|
||||||
|
"Tribute",
|
||||||
};
|
};
|
||||||
|
|
||||||
static Console::Color LogColors[EQEmuLogSys::MaxLogID] = {
|
static Console::Color LogColors[EQEmuLogSys::MaxLogID] = {
|
||||||
@ -89,17 +106,24 @@ static Console::Color LogColors[EQEmuLogSys::MaxLogID] = {
|
|||||||
|
|
||||||
|
|
||||||
EQEmuLogSys::EQEmuLogSys(){
|
EQEmuLogSys::EQEmuLogSys(){
|
||||||
// LogSettings log_settings;
|
|
||||||
for (int i = 0; i < EQEmuLogSys::LogCategory::MaxCategoryID; i++){
|
|
||||||
log_settings[i].log_to_console = 1;
|
|
||||||
std::cout << "Setting log settings for " << i << " " << LogCategoryName[i] << " " << std::endl;
|
|
||||||
}
|
|
||||||
std::cout << "I AM CONSTRUCTING!!!! LUL " << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EQEmuLogSys::~EQEmuLogSys(){
|
EQEmuLogSys::~EQEmuLogSys(){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EQEmuLogSys::LoadLogSettings()
|
||||||
|
{
|
||||||
|
log_platform = GetExecutablePlatformInt();
|
||||||
|
std::cout << "PLATFORM " << log_platform << std::endl;
|
||||||
|
for (int i = 0; i < EQEmuLogSys::LogCategory::MaxCategoryID; i++){
|
||||||
|
log_settings[i].log_to_console = 1;
|
||||||
|
log_settings[i].log_to_file = 1;
|
||||||
|
log_settings[i].log_to_gmsay = 1;
|
||||||
|
std::cout << "Setting log settings for " << i << " " << LogCategoryName[i] << " " << std::endl;
|
||||||
|
}
|
||||||
|
log_settings_loaded = true;
|
||||||
|
}
|
||||||
|
|
||||||
void EQEmuLogSys::StartZoneLogs(const std::string log_name)
|
void EQEmuLogSys::StartZoneLogs(const std::string log_name)
|
||||||
{
|
{
|
||||||
EQEmuLogSys::MakeDirectory("logs/zone");
|
EQEmuLogSys::MakeDirectory("logs/zone");
|
||||||
@ -149,6 +173,9 @@ void EQEmuLogSys::MakeDirectory(std::string directory_name){
|
|||||||
|
|
||||||
void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...)
|
void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...)
|
||||||
{
|
{
|
||||||
|
if (!log_settings_loaded){
|
||||||
|
EQEmuLogSys::LoadLogSettings();
|
||||||
|
}
|
||||||
if (log_type > EQEmuLogSys::MaxLogID){
|
if (log_type > EQEmuLogSys::MaxLogID){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,10 +46,26 @@ public:
|
|||||||
Detail, /* 2 - Use this for extreme detail in logging, usually in extreme debugging in the stack or interprocess communication */
|
Detail, /* 2 - Use this for extreme detail in logging, usually in extreme debugging in the stack or interprocess communication */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* If you add to this, make sure you update LogCategoryName in eqemu_logsys.cpp */
|
||||||
enum LogCategory {
|
enum LogCategory {
|
||||||
Netcode = 0,
|
Zone_Server = 0,
|
||||||
Guilds,
|
World_Server,
|
||||||
|
UCS_Server,
|
||||||
|
QS_Server,
|
||||||
|
WebInterface_Server,
|
||||||
|
AA,
|
||||||
|
Doors,
|
||||||
|
Guild,
|
||||||
|
Inventory,
|
||||||
|
Netcode,
|
||||||
|
Object,
|
||||||
Rules,
|
Rules,
|
||||||
|
Skills,
|
||||||
|
Spawns,
|
||||||
|
Spells,
|
||||||
|
Tasks,
|
||||||
|
Trading,
|
||||||
|
Tribute,
|
||||||
MaxCategoryID /* Don't Remove this*/
|
MaxCategoryID /* Don't Remove this*/
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -61,6 +77,7 @@ public:
|
|||||||
void MakeDirectory(std::string directory_name);
|
void MakeDirectory(std::string directory_name);
|
||||||
void SetCurrentTimeStamp(char* time_stamp);
|
void SetCurrentTimeStamp(char* time_stamp);
|
||||||
void StartZoneLogs(const std::string log_name);
|
void StartZoneLogs(const std::string log_name);
|
||||||
|
void LoadLogSettings();
|
||||||
|
|
||||||
struct LogSettings{
|
struct LogSettings{
|
||||||
uint8 log_to_file;
|
uint8 log_to_file;
|
||||||
@ -69,6 +86,8 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
LogSettings log_settings[EQEmuLogSys::LogCategory::MaxCategoryID];
|
LogSettings log_settings[EQEmuLogSys::LogCategory::MaxCategoryID];
|
||||||
|
bool log_settings_loaded = false;
|
||||||
|
int log_platform = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool zone_general_init = false;
|
bool zone_general_init = false;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user