Files
Bubberstation/code/__HELPERS/logging/talk.dm
nevimer 4e081a1d9d Public Logging (#1203)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

Gives the players a redacted version of the logs, ckeys filtered out for
public logging purposes.

<!-- Please make sure to actually test your PRs. If you have not tested
your PR mention it. -->

## Why It's Good For The Game

You can prove your cases in ahelps and appeals, reports, easier. 

## Proof Of Testing


![notepad_SbY9NX8Shd](https://github.com/Bubberstation/Bubberstation/assets/77420409/88c310dc-350e-4da8-b4c1-f93efff5a560)


## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

🆑
admin: added public log folder, and logging. 
/🆑

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->

<!-- By opening a pull request. You have read and understood the
repository rules located on the main README.md on this project. -->

---------

Co-authored-by: projectkepler-RU <99981766+projectkepler-ru@users.noreply.github.com>
Co-authored-by: Waterpig <49160555+Majkl-J@users.noreply.github.com>
2024-04-06 18:58:02 -04:00

48 lines
2.3 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]" : ""
log_message("[prefix][custom_say_emote ? "*[custom_say_emote]*, " : ""]\"[message]\"[suffix]", message_type, log_globally = log_globally)
// log_public_file(message) // BUBBER EDIT
/// Logging for generic spoken messages
/proc/log_say(text, list/data, redacted_log_text) // BUBBER EDIT
logger.Log(LOG_CATEGORY_GAME_SAY, text, data)
log_public_file(redacted_log_text) // BUBBER EDIT
/// Logging for whispered messages
/proc/log_whisper(text, list/data, redacted_log_text) // BUBBER EDIT
logger.Log(LOG_CATEGORY_GAME_WHISPER, text, data)
log_public_file(redacted_log_text) // BUBBER EDIT
/// 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"
source.log_talk(message, message_type, tag = "[tag] to [key_name(target)]")
if(source != target)
target.log_talk(message, LOG_VICTIM, tag = "[tag] from [key_name(source)]", log_globally = FALSE)
/// Logging for speech taking place over comms, as well as tcomms equipment
/proc/log_telecomms(text, list/data, redacted_log_text) // BUBBER EDIT
logger.Log(LOG_CATEGORY_TELECOMMS, text, data)
log_public_file(redacted_log_text) // BUBBER EDIT
/// Logging for speech indicators.
/proc/log_speech_indicators(text, list/data, redacted_log_text) // BUBBER EDIT
logger.Log(LOG_CATEGORY_SPEECH_INDICATOR, text, data)
log_public_file(redacted_log_text) // BUBBER EDIT