mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-06-02 22:08:36 -05:00
Monitor: Implement warnDeprecated (warns once)
This commit is contained in:
parent
55725c3ade
commit
13f10bb9f6
|
|
@ -62,6 +62,7 @@ export const Monitor = new class {
|
|||
battlePreps = new TimedCounter();
|
||||
groupChats = new TimedCounter();
|
||||
tickets = new TimedCounter();
|
||||
deprecationsWarned = new Set();
|
||||
|
||||
activeIp: string | null = null;
|
||||
networkUse: { [k: string]: number } = {};
|
||||
|
|
@ -160,6 +161,12 @@ export const Monitor = new class {
|
|||
}
|
||||
}
|
||||
|
||||
warnDeprecated(text: string, details = '') {
|
||||
if (this.deprecationsWarned.has(text)) return;
|
||||
this.deprecationsWarned.add(text);
|
||||
return this.warn(`${text}${details}`);
|
||||
}
|
||||
|
||||
slow(text: string) {
|
||||
const logRoom = Rooms.get('slowlog');
|
||||
if (logRoom) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user