Files
CHOMPStation2/code/_helpers/logging/admin.dm
2025-09-14 20:05:26 +02:00

43 lines
1.8 KiB
Plaintext

/* Items with ADMINPRIVATE prefixed are stripped from public logs. */
// For backwards compatibility these are currently also added to LOG_CATEGORY_GAME with their respective prefix
// This is to avoid breaking any existing tools that rely on the old format, but should be removed in the future
/// General logging for admin actions
/proc/log_admin(text, list/data)
GLOB.admin_activities.Add(text)
logger.Log(LOG_CATEGORY_ADMIN, text, data)
logger.Log(LOG_CATEGORY_COMPAT_GAME, "ADMIN: [text]")
/// General logging for admin actions
/proc/log_admin_private(text, list/data)
GLOB.admin_activities.Add(text)
logger.Log(LOG_CATEGORY_ADMIN_PRIVATE, text, data)
logger.Log(LOG_CATEGORY_COMPAT_GAME, "ADMINPRIVATE: [text]")
/// Logging for AdminSay (ASAY) messages
/proc/log_adminsay(text, list/data)
GLOB.admin_activities.Add(text)
logger.Log(LOG_CATEGORY_ADMIN_PRIVATE_ASAY, text, data)
logger.Log(LOG_CATEGORY_COMPAT_GAME, "ADMINPRIVATE: ASAY: [text]")
/proc/log_modsay(text, list/data)
logger.Log(LOG_CATEGORY_ADMIN_PRIVATE_MSAY, text, data)
logger.Log(LOG_CATEGORY_COMPAT_GAME, "ADMINPRIVATE: MODSAY: [text]")
/proc/log_eventsay(text, list/data)
logger.Log(LOG_CATEGORY_ADMIN_PRIVATE_ESAY, text, data)
logger.Log(LOG_CATEGORY_COMPAT_GAME, "ADMINPRIVATE: EVENTSAY: [text]")
/**
* Writes to a special log file if the log_suspicious_login config flag is set,
* which is intended to contain all logins that failed under suspicious circumstances.
*
* Mirrors this log entry to log_access when access_log_mirror is TRUE, so this proc
* doesn't need to be used alongside log_access and can replace it where appropriate.
*/
/proc/log_suspicious_login(text, list/data, access_log_mirror = TRUE)
logger.Log(LOG_CATEGORY_SUSPICIOUS_LOGIN, text)
if(access_log_mirror)
log_access(text)