Skip to content

log

Source: base/tealdef/scripts/log.d.tl

Notes

Types of the global log table, the game's script logging functions.

log

record global base/tealdef/scripts/log.d.tl:3

global record log

Notes

Global logging functions available to all game scripts.

Functions

verbose(string) base/tealdef/scripts/log.d.tl:4

Notes

Writes a verbose (debug) message to the game log.

Used in the base game: 75 times in 31 files

base/content/base/base/mod.script.tl:498

log.verbose(debugString)
base/content/climates/climates/gen/mapgenutil.tl:33
log.verbose(string.format("Looking for %s river starts, got %s", spawnAttempts, #starts))
base/content/game_mechanics/game_mechanics/company/company.script.tl:127
log.verbose("Prospection: failed to spawn industry of types: " .. tostring(industriesString))
base/content/game_mechanics/game_mechanics/company/company_growth.script.tl:145
log.verbose("Add company experience")
base/content/game_mechanics/game_mechanics/company/company_util.tl:129
log.verbose(str)
base/content/game_mechanics/game_mechanics/emission/emissions.script.tl:266
log.verbose("handleEvent " .. id .." - " .. name)
… and 25 more files.

message(string) base/tealdef/scripts/log.d.tl:5

Notes

Writes an informational message to the game log.

Used in the base game: 58 times in 31 files

base/content/base/base/init.lua:127

log.message(table.concat(parts))
base/content/base/base/model_metadata_util.lua:1476
log.message("rotationSpeedByLifetime in " .. fileName .. " got removed. Added " .. addRot .. " to rotationSpeed to compensate for the previous value. Please ver
base/content/climates/climates/gen/mapgenutil.tl:260
log.message(string.format("Breaking river %s due to intersection", config.currentRiverId))
base/content/game_mechanics/game_mechanics/achievements/achievements.script.tl:85
log.message(lang_util.format("Updating legacy achievement state from version: {fromVersion} to version: {toVersion}", {
base/content/game_mechanics/game_mechanics/company/company.script.tl:397
log.message("Reset company progression due to initNewGameFromMap/initMission event")
base/content/game_mechanics/game_mechanics/company/company_growth.script.tl:59
log.message("applied level: " .. levelToApply)
… and 25 more files.

warning(string) base/tealdef/scripts/log.d.tl:6

Notes

Writes a warning to the game log.

Used in the base game: 122 times in 70 files

base/content/base/base/difficulty_util.tl:239

log.warning(lang_util.format("Did not find {modParam}, hence no difficulty scale can be provided.", { modParam = modParam }))
base/content/base/base/metadataanimationutil.lua:61
log.warning(string.format("metadataanimationutil.attachAnimations %s animation already exists - config ignored! fileName: %s", eventName, fileName))
base/content/base/base/mod.lua:180
log.warning("Skipped translation: Called '_' with a table instead of a string: " .. toString(id))
base/content/base/base/mod.script.tl:707
log.warning("Set initial weahter state got invalid index.")
base/content/buildings/townbuildingutil.lua:35
log.warning("Scaffold face too short")
base/content/game_mechanics/game_mechanics/company/company.script.tl:260
log.warning("Company entity does not exist anymore: " .. companyState.companyEntity.entity)
… and 64 more files.

error(string, ?string) base/tealdef/scripts/log.d.tl:7

Notes

Writes an error to the game log.

Parameter Type Description
#1 string The error message.
#2 ?string Optional extra context, which the base game uses for the values involved.

Example

log.error("Could not find construction", "resName = " .. tostring(resName))
Used in the base game: 218 times in 114 files

base/content/base/base/init.lua:246

log.error("Creating globals by assignment is not allowed (variable was )\nDid you forget to add 'local' before your variable?", "key = " .. tostring(key))
base/content/base/base/tl.lua:6911
log.error("teal (content/base/tl.lua): search_for not implemented: with suffix", "module_name = " .. tostring(module_name) .. ", suffix = " .. tostring(suffix))
base/content/game_mechanics/game_mechanics/company/explorations/exploration_plane.script.tl:102
log.error("Model not spawned")
base/content/game_mechanics/game_mechanics/finance/finances_loan_gui.tl:391
log.error("Invalid config for custom card: Cannot be obtained, available only!")
base/content/game_mechanics/game_mechanics/fun_elements/custom_entity_util.tl:25
log.error("Model not found:", "model = " .. model)
base/content/game_mechanics/game_mechanics/fun_elements/ufo_util.tl:71
log.error("Model not found", "model = " .. model)
… and 108 more files.