mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
Keep mlog happy until it is completely replaced
This commit is contained in:
parent
2bc6ed17c7
commit
a6c521a73e
@ -159,7 +159,7 @@ extern void log_raw_packet(LogType type, uint16 seq, const BasePacket *p);
|
|||||||
extern void log_packet_mob(LogType type, Mob *who, const BasePacket *p);
|
extern void log_packet_mob(LogType type, Mob *who, const BasePacket *p);
|
||||||
#define mpkt( type, packet) \
|
#define mpkt( type, packet) \
|
||||||
do { \
|
do { \
|
||||||
if(IsLoggingEnabled()) \
|
if(1) \
|
||||||
if(log_type_info[ type ].enabled) { \
|
if(log_type_info[ type ].enabled) { \
|
||||||
log_packet_mob(type, this, packet); \
|
log_packet_mob(type, this, packet); \
|
||||||
} \
|
} \
|
||||||
|
|||||||
@ -25,8 +25,8 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
void log_message_mob(LogType type, Mob *who, const char *fmt, ...) {
|
void log_message_mob(LogType type, Mob *who, const char *fmt, ...) {
|
||||||
if(!who->IsLoggingEnabled())
|
// if(!who->IsLoggingEnabled())
|
||||||
return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common
|
// return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common
|
||||||
|
|
||||||
char prefix_buffer[256];
|
char prefix_buffer[256];
|
||||||
snprintf(prefix_buffer, 255, "[%s] %s: ", log_type_info[type].name, who->GetName());
|
snprintf(prefix_buffer, 255, "[%s] %s: ", log_type_info[type].name, who->GetName());
|
||||||
@ -39,8 +39,8 @@ void log_message_mob(LogType type, Mob *who, const char *fmt, ...) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void log_message_mobVA(LogType type, Mob *who, const char *fmt, va_list args) {
|
void log_message_mobVA(LogType type, Mob *who, const char *fmt, va_list args) {
|
||||||
if(!who->IsLoggingEnabled())
|
// if(!who->IsLoggingEnabled())
|
||||||
return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common
|
// return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common
|
||||||
|
|
||||||
char prefix_buffer[256];
|
char prefix_buffer[256];
|
||||||
snprintf(prefix_buffer, 255, "[%s] %s: ", log_type_info[type].name, who->GetName());
|
snprintf(prefix_buffer, 255, "[%s] %s: ", log_type_info[type].name, who->GetName());
|
||||||
@ -50,15 +50,15 @@ void log_message_mobVA(LogType type, Mob *who, const char *fmt, va_list args) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void log_hex_mob(LogType type, Mob *who, const char *data, uint32 length, uint8 padding) {
|
void log_hex_mob(LogType type, Mob *who, const char *data, uint32 length, uint8 padding) {
|
||||||
if(!who->IsLoggingEnabled())
|
// if(!who->IsLoggingEnabled())
|
||||||
return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common
|
// return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common
|
||||||
|
|
||||||
log_hex(type,data,length,padding);
|
log_hex(type,data,length,padding);
|
||||||
}
|
}
|
||||||
|
|
||||||
void log_packet_mob(LogType type, Mob *who, const BasePacket *p) {
|
void log_packet_mob(LogType type, Mob *who, const BasePacket *p) {
|
||||||
if(!who->IsLoggingEnabled())
|
// if(!who->IsLoggingEnabled())
|
||||||
return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common
|
// return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common
|
||||||
|
|
||||||
char buffer[80];
|
char buffer[80];
|
||||||
p->build_header_dump(buffer);
|
p->build_header_dump(buffer);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user