Commit Graph

7 Commits

Author SHA1 Message Date
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
SkyratBot
a8c10d1659 [MIRROR] Converts a shitload of istypes to their more concise macros [MDB IGNORE] (#15702)
Converts a shitload of istypes to their more concise macros

Co-authored-by: Seth Scherer <supernovaa41@gmx.com>
Co-authored-by: GoldenAlpharex <jerego1234@hotmail.com>
2022-08-27 16:23:44 -04:00
GoldenAlpharex
4447eb122f Fixes SQL game logs throwing a bunch of SQL errors (#15773)
* Increases the list nesting by one on log entries for the mass insert log

* Updates the name of the time column because of course I had to get it wrong :)
2022-08-25 07:12:37 +02:00
SkyratBot
def879e5b4 [MIRROR] Refactors admin PMs to be hopefully more resilient [MDB IGNORE] (#15348)
* Refactors admin PMs to be hopefully more resilient

* autoconflict resolution

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2022-08-04 15:47:52 +01:00
GoldenAlpharex
bbbe0682d8 Optimizes SQL logging and adds missing related default config entries (#15330)
* Adds a new config entry for SQL game log bundle query size

Also adds documentation to existing config entries that don't currently appear in any default entry files on the repo.

* Adds a new config file for database-related configs for Skyrat

* Adds a `add_log_to_mass_insert_queue` proc to handle bundling insert queries into bigger, less frequent queries

* Modifies log_message() to utilise the new add_log_to_mass_insert_queue() proc

* Actually makes the MassInsert() call asynchronous, to completely remove the freezes

* Adds code to handle sending all unsent logs to the database before the subsystem is shutdown, to reduce the loss of logs at the end of a round
2022-08-02 18:04:18 -04:00
SkyratBot
7a653adfbb [MIRROR] TGUI Say: Upgrades chat input with modern features [MDB IGNORE] (#14375)
* TGUI Say: Upgrades chat input with modern features

* yes

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2022-06-17 02:12:42 +01:00
SkyratBot
2da69ce304 [MIRROR] Split and Document Logging Procs [MDB IGNORE] (#13707)
* Split and Document Logging Procs

* Update _logging.dm

* Update atoms.dm

* Update mob_helpers.dm

* Update mob.dm

Co-authored-by: dragomagol <66640614+dragomagol@users.noreply.github.com>
Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
2022-05-19 01:18:40 +01:00