> For the complete documentation index, see [llms.txt](https://wiki.redmodding.org/cyber-engine-tweaks/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.redmodding.org/cyber-engine-tweaks/cet-functions/misc/debug-functions.md).

# Debug functions

## print()

Prints one or more objects to the [CET Console](/cyber-engine-tweaks/console/console.md) and [CET Console Logs](/cyber-engine-tweaks/first-steps/logs-debug.md#cet-console-logs) file. Multiple objects will be printed separated by a space.

#### Definition

```swift
print(obj: object, [obj2: object, [...]]) -> nil
```

#### Usage example

{% code title="init.lua" %}

```lua
print('Hey', 'there', 1, 2, true)
```

{% endcode %}

{% code title="<console>" %}

```
> Hey there 1 2 true
```

{% endcode %}

## spdlog

Write a string in the [Individual Mod Logs](/cyber-engine-tweaks/first-steps/logs-debug.md#individual-mod-logs) file, eg, `<`[`cet_path`](#user-content-fn-1)[^1]`>/mods/my_mod/my_mod.log`.

There are several `spdlog` methods, all are identical and have the same output:

* `spdlog.debug()`
* `spdlog.trace()`
* `spdlog.info()`
* `spdlog.warning()`
* `spdlog.error()`
* `spdlog.critical()`

#### Definition

```swift
spdlog.info(string: string) -> nil
```

#### Usage example

{% code title="init.lua" %}

```lua
spdlog.info('Custom log')
```

{% endcode %}

{% code title="my\_mod.log" %}

```
> [02:31:08] Cutom log
```

{% endcode %}

#### Usage tips

It is recommended to use `spdlog.info(tostring(my_var))` to make sure the variable is compatible, as `boolean`, `interger` and other types will throw an error.

## Dump()

Returns a JSON-ish string with details about the members of `obj`:

* Type name
* Instance functions
* Static functions
* Properties

The listed functions include their signatures.

If `detailed` is true, function descriptions will include the function's full name hash, short name, and short name hash.

{% hint style="info" %}
`obj` must be an instance of a wrapped game type, such as `PlayerPuppet` which is returned by `Game.GetPlayer()`. [DumpAllTypeNames()](#dumpalltypenames) will dump the names of all such types.
{% endhint %}

#### Definition

```swift
Dump(obj: GameDataType, detailed: bool) -> string
```

#### Usage example

{% code title="init.lua" %}

```lua
print(Dump(Game.GetPlayer(), false))
```

{% endcode %}

<pre data-title="<console>"><code>{
    name: PlayerPuppet,
<strong>    functions: {
</strong>        IsPlayer() => (Bool),
        IsReplacer() => (Bool),
        IsVRReplacer() => (Bool),
        IsJohnnyReplacer() => (Bool),
        IsReplicable() => (Bool),
        GetReplicatedStateClass() => (CName),
        IsCoverModifierAdded() => (Bool),
        IsWorkspotDamageReductionAdded() => (Bool),
        IsWorkspotVisibilityReductionActive() => (Bool),
        GetOverlappedSecurityZones() => (array:gamePersistentID),
        ...
}
</code></pre>

## GameDump()

Returns the game's internal debug string for the given object. This string displays the object's properties and their values.

{% hint style="warning" %}
Beware that this string probably won't have any line breaks, so it's more advisable to open `<`[`cet_path`](#user-content-fn-1)[^1]`>/scripting.log` in a text editor with line wrapping to view the output of this function.
{% endhint %}

#### Definition

```swift
GameDump(obj: GameDataType) -> string
```

#### Usage example

{% code title="init.lua" %}

```lua
print(GameDump(Game.GetPlayer()))
```

{% endcode %}

{% code title="<console>" %}

```
> PlayerPuppet[ customCameraTarget:ECCTV_OnlyOnscreen, renderSceneLayerMask:<Default;Cyberspace>, persistentState:, playerSocket:gamePlayerSocket[ ], ...]
```

{% endcode %}

## DumpType()

Like [Dump()](#dump), but takes a type name rather than an object instance. Use [DumpAllTypeNames()](#dumpalltypenames) to get a list of all types.

#### Definition

```swift
DumpType(typeName: string, detailed: boolean) -> string
```

#### Usage example

{% code title="init.lua" %}

```lua
print(DumpType('PlayerPuppet', false))
```

{% endcode %}

{% code title="<console>" %}

```
{
    name: PlayerPuppet,
    functions: {
        IsPlayer() => (Bool),
        IsReplacer() => (Bool),
        IsVRReplacer() => (Bool),
        IsJohnnyReplacer() => (Bool),
        IsReplicable() => (Bool),
        GetReplicatedStateClass() => (CName),
        IsCoverModifierAdded() => (Bool),
        IsWorkspotDamageReductionAdded() => (Bool),
        IsWorkspotVisibilityReductionActive() => (Bool),
        GetOverlappedSecurityZones() => (array:gamePersistentID),
        ...
}
```

{% endcode %}

## DumpAllTypeNames()

Dump all type names to `<`[`cet_path`](#user-content-fn-1)[^1]`>/cyber_engine_tweaks.log` and prints to the [CET Console](/cyber-engine-tweaks/console/console.md) the number of types dumped.

#### Definition

```swift
DumpAllTypeNames() -> nil
```

#### Usage example

{% code title="init.lua" %}

```lua
DumpAllTypeNames()
```

{% endcode %}

{% code title="<console>" %}

```
> Dumped 26811 types
```

{% endcode %}

{% code title="\<cyber\_engine\_tweaks.log>" %}

```
[operator ()] [4416] handle:gamedataUICharacterCreationAttribute_Record
[operator ()] [4416] DamageTypeIndicator
[operator ()] [4416] worldAIDirectorSpawnNode
[operator ()] [4416] UI_DEV_ScriptableSystemUseNewTooltips
[operator ()] [4416] array:SDocumentThumbnailWidgetPackage
[operator ()] [4416] gameIPersistencySystem
[operator ()] [4416] DelayedComDeviceClose
[operator ()] [4416] inkSettingsSelectorController
[operator ()] [4416] array:handle:AICombatSquadScriptInterface
[operator ()] [4416] animAnimNode_LocomotionAdjusterOnEvent
[operator ()] [4416] whandle:gamedataLightPreset_Record
[operator ()] [4416] handle:C4ControllerPS
...
```

{% endcode %}

[^1]: The directory where Cyber Engine Tweaks is installed.

    Usually: C:/Program Files (x86)/Steam/steamapps/common/Cyberpunk 2077/bin/x64/plugins/cyber\_engine\_tweaks


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://wiki.redmodding.org/cyber-engine-tweaks/cet-functions/misc/debug-functions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
