mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-26 14:47:50 +01:00
[MIRROR] JSON Logging Refactor (#11623)
Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
co-authored by
Selis
Kashargul
parent
272afa33c8
commit
5a62077f2c
@@ -0,0 +1,19 @@
|
||||
/// Conveys all log_mapping messages as unit test failures, as they all indicate mapping problems.
|
||||
/datum/unit_test/log_mapping
|
||||
// Happen before all other tests, to make sure we only capture normal mapping logs.
|
||||
priority = TEST_PRE
|
||||
|
||||
/datum/unit_test/log_mapping/Run()
|
||||
var/static/regex/test_areacoord_regex = regex(@"\(-?\d+,-?\d+,(-?\d+)\)")
|
||||
|
||||
for(var/log_entry in GLOB.unit_test_mapping_logs)
|
||||
// Only fail if AREACOORD was conveyed, and it's a station or mining z-level. FIXME: SEE BELOW!
|
||||
// This is due to mapping errors don't have coords being impossible to diagnose as a unit test,
|
||||
// and various ruins frequently intentionally doing non-standard things.
|
||||
if(!test_areacoord_regex.Find(log_entry))
|
||||
continue
|
||||
// var/z = text2num(test_areacoord_regex.group[1])
|
||||
//if(!is_station_level(z) && !is_mining_level(z)) // FIXME: We cannot check for these yet!
|
||||
// continue
|
||||
|
||||
TEST_FAIL(log_entry)
|
||||
Reference in New Issue
Block a user