mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-02 12:36:36 +00:00
[Logging] Netcode Logging Unify (#2443)
* [Logging] Unify netcode logging * More tweaks, generator * Exclude OP_SpecialMesg at callback level * Consolidate packet loggers * Log at EQStream level instead of proxy * Fix C->S * Server to server logging * C-S for Loginserver * Hook UCS for C->S * Update eqemu_logsys.h * World C->S logging * Translate opcodes through patch system for client to server * Additional logging requests * Add detailed opcode translation logging * vStringFormat resiliency * Translate loginserver C->S * Simplify out message string (reduce copies) and ignore legacy formats * Update eqemu_logsys.cpp * Log file format * Handle deprecated categories
This commit is contained in:
+53
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
|
||||
my $filename = './common/eqemu_logsys.h';
|
||||
open(my $fh, '<:encoding(UTF-8)', $filename)
|
||||
or die "Could not open file '$filename' $!";
|
||||
|
||||
my $contents = "";
|
||||
while (my $row = <$fh>) {
|
||||
chomp $row;
|
||||
$contents .= $row . "\n";
|
||||
}
|
||||
|
||||
my @enum = split('enum LogCategory \{', $contents);
|
||||
|
||||
if (scalar(@enum) > 0) {
|
||||
# print $enum[1];
|
||||
my @second_split = split('};', $enum[1]);
|
||||
if (scalar(@second_split) > 0) {
|
||||
my $categories = $second_split[0];
|
||||
$categories =~ s/^\s+//;
|
||||
$categories =~ s/\s+$//;
|
||||
$categories =~ s/ //g;
|
||||
$categories =~ s/ //g;
|
||||
$categories =~ s/\n//g;
|
||||
$categories =~ s/None=0,//g;
|
||||
$categories =~ s/,MaxCategoryID//g;
|
||||
$categories =~ s/\/\*//g;
|
||||
$categories =~ s/\*\///g;
|
||||
$categories =~ s/Don'tRemovethis//g;
|
||||
|
||||
my @cats = split(',', $categories);
|
||||
|
||||
foreach my $cat (@cats) {
|
||||
print "#define Log" . $cat . "(message, ...) do {\\
|
||||
if (LogSys.IsLogEnabled(Logs::General, Logs::" . $cat . "))\\
|
||||
OutF(LogSys, Logs::General, Logs::" . $cat . ", __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\\
|
||||
} while (0)
|
||||
|
||||
#define Log" . $cat . "Detail(message, ...) do {\\
|
||||
if (LogSys.IsLogEnabled(Logs::Detail, Logs::" . $cat . "))\\
|
||||
OutF(LogSys, Logs::Detail, Logs::" . $cat . ", __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\\
|
||||
} while (0)
|
||||
|
||||
";
|
||||
# print "$cat\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
close $fh;
|
||||
Reference in New Issue
Block a user