mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-01 14:21:37 +00:00
More
This commit is contained in:
@@ -143,6 +143,7 @@ namespace Logs {
|
||||
Corpses,
|
||||
XTargets,
|
||||
EvolveItem,
|
||||
Visibility,
|
||||
MaxCategoryID /* Don't Remove this */
|
||||
};
|
||||
|
||||
@@ -244,7 +245,8 @@ namespace Logs {
|
||||
"EqTime",
|
||||
"Corpses",
|
||||
"XTargets",
|
||||
"EvolveItem"
|
||||
"EvolveItem",
|
||||
"Visibility"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -854,6 +854,16 @@
|
||||
OutF(LogSys, Logs::Detail, Logs::XTargets, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogVisibility(message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(Logs::General, Logs::Visibility))\
|
||||
OutF(LogSys, Logs::General, Logs::Visibility, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define LogVisibilityDetail(message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(Logs::Detail, Logs::Visibility))\
|
||||
OutF(LogSys, Logs::Detail, Logs::Visibility, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#define Log(debug_level, log_category, message, ...) do {\
|
||||
if (LogSys.IsLogEnabled(debug_level, log_category))\
|
||||
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
|
||||
|
||||
@@ -86,6 +86,9 @@ struct BenchTimer
|
||||
void reset() { start_time = clock::now(); }
|
||||
// this is seconds
|
||||
double elapsed() { return std::chrono::duration<double> (clock::now() - start_time).count(); }
|
||||
std::chrono::milliseconds::rep elapsedMilliseconds() { return std::chrono::duration_cast<std::chrono::milliseconds>(clock::now() - start_time).count(); }
|
||||
std::chrono::microseconds::rep elapsedMicroseconds() { return std::chrono::duration_cast<std::chrono::microseconds>(clock::now() - start_time).count(); }
|
||||
std::chrono::nanoseconds::rep elapsedNanoseconds() { return std::chrono::duration_cast<std::chrono::nanoseconds>(clock::now() - start_time).count(); }
|
||||
private:
|
||||
std::chrono::time_point<std::chrono::high_resolution_clock> start_time;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user