mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-22 16:12:19 +00:00
* Initial * Cleared duplicates * More work, get rid of log_error * more * log_debug() to macro LOG_DEBUG * More work * More * Guh * Maybe better? * More work * gah * Dear lord * *inserts swears here* * gdi * More work * More * dear lord * fsdfsdafs * rsdaf * sadfasf * sdafsad * fgsd * small fuckup fix * jfsd * sdafasf * gdi * sdfa * sfdafgds * sdafasdvf * sdfasdfg * sdfsga * asdf * dsfasfsagf * ihibhbjh * fsadf * adfas * sdafsad * sdfasd * fsda * vhb * asf * for arrow * removed source file-line logging, added header for tgui
49 lines
2.1 KiB
Plaintext
49 lines
2.1 KiB
Plaintext
/**
|
|
* Helper for logging chat messages or other logs with arbitrary inputs (e.g. announcements)
|
|
*
|
|
* This proc compiles a log string by prefixing the tag to the message
|
|
* and suffixing what it was forced_by if anything
|
|
* if the message lacks a tag and suffix then it is logged on its own
|
|
* Arguments:
|
|
* * message - The message being logged
|
|
* * message_type - the type of log the message is(ATTACK, SAY, etc)
|
|
* * tag - tag that indicates the type of text(announcement, telepathy, etc)
|
|
* * log_globally - boolean checking whether or not we write this log to the log file
|
|
* * forced_by - source that forced the dialogue if any
|
|
*/
|
|
/atom/proc/log_talk(message, message_type, tag = null, log_globally = TRUE, forced_by = null, custom_say_emote = null)
|
|
var/prefix = tag ? "([tag]) " : ""
|
|
var/suffix = forced_by ? " FORCED by [forced_by]" : ""
|
|
WRITE_LOG(config.logfiles["world_game_log"], "[prefix][custom_say_emote ? "*[custom_say_emote]*, " : ""]\"[message]\"[suffix] - [message_type]")
|
|
|
|
/// Logging for generic spoken messages
|
|
/proc/_log_say(text)
|
|
#if defined(UNIT_TEST)
|
|
LOG_GITHUB_DEBUG("SAY: [text]")
|
|
#else
|
|
if (config.logsettings["log_say"])
|
|
WRITE_LOG(config.logfiles["world_game_log"], "SAY: [text]")
|
|
#endif
|
|
|
|
/// Logging for whispered messages
|
|
/proc/_log_whisper(text)
|
|
if (config.logsettings["log_whisper"])
|
|
WRITE_LOG(config.logfiles["world_game_log"], "WHISPER: [text]")
|
|
|
|
/// Helper for logging of messages with only one sender and receiver (i.e. mind links)
|
|
/proc/log_directed_talk(atom/source, atom/target, message, message_type, tag)
|
|
if(!tag)
|
|
stack_trace("Unspecified tag for private message")
|
|
tag = "UNKNOWN"
|
|
WRITE_LOG(config.logfiles["world_game_log"], "[target] received [message] of type [message_type] - [tag] from [source]")
|
|
|
|
/// Logging for speech taking place over comms, as well as tcomms equipment
|
|
/proc/log_telecomms(text)
|
|
if (config.logsettings["log_telecomms"])
|
|
WRITE_LOG(config.logfiles["world_telecomms_log"], "TCOMMS: [text]")
|
|
|
|
/// Logging for speech indicators.
|
|
/proc/log_speech_indicators(text)
|
|
if (config.logsettings["log_speech_indicators"])
|
|
WRITE_LOG(config.logfiles["world_speech_indicators_log"], "SPEECH INDICATOR: [text]")
|