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: 85 times in 31 files

base/content/climates/climates/gen/mapgenutil.tl:33

log.verbose(string.format("Looking for %s river starts, got %s", spawnAttempts, #starts))
base/content/base/base/mod.script.tl:498
log.verbose(debugString)
base/content/mission/mission/mission_sim.script.tl:126
log.verbose("Added new task: " .. state.tasks[#state.tasks].genericState.config.uniqueKey)
base/content/mission/mission/mission_framework/mission_framework_react.tl:716
log.verbose("close MissionEntityWindowWrapper due to invalid param")
base/content/mission/mission/guide_system/guide_system_react.tl:258
log.verbose("Component " .. desiredGuide.info.targets[1].idOrTag .. " not found for guide: " .. desiredGuide.info.name)
base/content/gui/gui/node_editor/layer_nodes.script.tl:273
log.verbose("River rejected")
… 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: 56 times in 30 files

base/content/climates/climates/gen/mapgenutil.tl:260

log.message(string.format("Breaking river %s due to intersection", config.currentRiverId))
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/mission/mission/mission_sim.script.tl:171
log.message("Spawned new task: " .. taskConfig.uniqueKey)
base/content/mission/mission/name_util.tl:194
log.message("nameutil tag check completed " .. (err == 0 and "successfully" or ("with " .. err .. " errors")))
base/content/mission/mission/mission_framework/mission_legacy_util.tl:15
log.message(lang_util.format("Updating legacy mission state from version: {fromVersion} to version: {toVersion}", {
… and 24 more files.

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

Notes

Writes a warning to the game log.

Used in the base game: 121 times in 68 files

base/content/buildings/townbuildingutil.lua:35

log.warning("Scaffold face too short")
base/content/terrain/reforestation.script.tl:33
log.warning(lang_util.format("Number of tiles per month or steps changed. Old number of tiles was {oldTiles}, new is {newTiles}. Old number of steps was {oldSte
base/content/landmarks/landmark_util.tl:12
log.warning("No town found for construction entity " .. constructionEntity)
base/content/landmarks/landmarks_notification.script.tl:60
log.warning("No metadata given for: " .. con.fileName)
base/content/model_editor/model_editor/editor_base_mod.lua:188
log.warning("CARGO ID: " .. oldCargoType .. " converted to " .. resName .. " PLEASE UPDATE: " .. debugContext)
base/content/base/base/mod.script.tl:707
log.warning("Set initial weahter state got invalid index.")
… and 62 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: 211 times in 113 files

base/content/vehicle/vehicle_modifier.script.tl:73

log.error("Entity in VehicleModifier does not exist.", "entity = " .. tostring(param.entity))
base/content/landmarks/landmarks.script.tl:129
log.error("Unknown carrier: in constructions", "c = " .. c .. ", allConstructions = " .. allConstructions)
base/content/landmarks/landmark_util.tl:89
log.error("No bonuses type selected for getTownsBonuses")
base/content/landmarks/hq/hq/headquarter.script.tl:89
log.error("No slot of type configured:", "slotType = " .. slotType)
base/content/base/base/init.lua:242
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))
… and 107 more files.