Files
Bubberstation/code/__HELPERS/logging/_logging.dm
SkyratBot bf784520b8 [MIRROR] Handles Log_Globally Being True When Log Type is LOG_VICTIM [MDB IGNORE] (#18663)
* Handles Log_Globally Being True When Log Type is LOG_VICTIM (#72643)

## About The Pull Request

Victim procs would cause a [runtime, click on me for a link to the
runtimebus
entry](https://runtimes.moth.fans/runtime/Invalid%20individual%20logging%20type%3A%20524288.%20Defaulting%20to%204096%20(LOG_GAME).%20(code%2F__HELPERS%2Flogging%2F_logging.dm%3A120)_______%2Fproc%2F_stack_trace)
when you tried to put a victim log in globally. This was the runtime
error for future reference, via
https://tgstation13.download/parsed-logs/manuel/data/logs/2023/01/06/round-197717/runtime.condensed.txt
-

```
The following runtime has occurred 3155 time(s).
runtime error: Invalid individual logging type: 524288. Defaulting to 4096 (LOG_GAME). (code/__HELPERS/logging/_logging.dm:120)
proc name:  stack trace (/proc/_stack_trace)
  source file: stack_trace.dm,4
  usr: 0
  src: null
```

`524288` is the bitflag for `LOG_VICTIM`.

I added in a custom error message for passing in LOG_VICTIM without
adding log_globally just so that we can pick up on it faster without
having to look up the bitflags. I think I prefer it failing loudly as
opposed to just returning, so that people can much more easily pick up
on this behavior being a wrong one. The pattern across the codebase
prior to this PR was pass in log_globally as false along with LOG_VICTIM
in the args to `log_message()`, so I decided to enforce doing that in
this PR. Alternative fix could be to just early return on LOG_VICTIM,
but that would leave a larger footprint and might be better suited for a
different PR, preferably after this one at least gets all of our ducks
in a row.
## Why It's Good For The Game

runtimes bad, actual logging of important stuff good.

apologies if i screwed up how LOG_VICTIM is meant to be used, but
something is definitely wrong and should be addressed. i'm pretty sure
victim logs are only done in addition to a proper log that gets sent
globally, and this is good just for visibility?
## Changelog
Nothing that players would notice.

* Handles Log_Globally Being True When Log Type is LOG_VICTIM

Co-authored-by: san7890 <the@san7890.com>
2023-01-12 12:15:49 -08:00

6.9 KiB