Difference between revisions of "Enable Debug Logging"

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search
imported>Cobalt027
m (Correcting paths)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The [http://www.creationkit.com/fallout4/index.php?title=Debug_Script Debug] Script offers many methods for diagnosing and tracing execution of Papyrus Scripts such as:
The [[Debug Script]] offers many methods for diagnosing and tracing execution of [[Papyrus]] scripts.
 
The following are some of the most commonly used.
<source lang="papyrus">
Debug.Trace("This message is written to the papyrus log file.")
Debug.Notification("This message is displayed on the HUD menu.")
Debug.MessageBox("This message is displayed in a message box.")
Debug.CenterOnCell("QASmoke")
Debug.DumpEventRegistrations(self)
</source>


Debug.Trace("I'm logged as an INFO message")
Debug.Trace("I'm logged as a WARNING message",1)
Debug.Trace("I'm logged as an ERROR message",0)
Debug.DumpEventRegistrations(self)


However, these methods will not work unless you enable logging:
However, these methods will not work unless you enable logging:
# Open the file "<code>..\Documents\My Games\Fallout4\Fallout4Custom.ini</code>".
# Populate the <code>Fallout4Custom.ini</code> file with the following settings.
Log output from [[Papyrus]] will be written to <code>..\Documents\My Games\Fallout4\Logs\Script\Papyrus.0.log</code> or <code>..\Documents\My Games\Fallout4\Logs\Script\User\</code> if you have configured a user log.


# Open the file :  <Documents>\My Games\Fallout 4\Fallout4Custom.ini
==== ..\Documents\My Games\Fallout 4\Fallout4Custom.ini ====
# Populate the Fallout4Custom.ini file with the following:
<source lang="ini">
[Papyrus]
bEnableLogging=1
bEnableTrace=1
bLoadDebugInformation=1
bEnableProfiling=1
sDefaultLogOverlay=Papyrus
</source>


[Papyrus]
bEnableLogging=1
bEnableTrace=1
bLoadDebugInformation=1
bEnableProfiling=1
sDefaultLogOverlay=Papyrus


'''NOTE:''' Log output from Fallout 4 will be written to <Documents>\My Games\Fallout 4\Logs\Script\
[[Category:Game Configurations]]
[[Category:Papyrus Configurations]]

Latest revision as of 04:18, 7 May 2022

The Debug Script offers many methods for diagnosing and tracing execution of Papyrus scripts.

The following are some of the most commonly used.

Debug.Trace("This message is written to the papyrus log file.")
Debug.Notification("This message is displayed on the HUD menu.")
Debug.MessageBox("This message is displayed in a message box.")
Debug.CenterOnCell("QASmoke")
Debug.DumpEventRegistrations(self)


However, these methods will not work unless you enable logging:

  1. Open the file "..\Documents\My Games\Fallout4\Fallout4Custom.ini".
  2. Populate the Fallout4Custom.ini file with the following settings.

Log output from Papyrus will be written to ..\Documents\My Games\Fallout4\Logs\Script\Papyrus.0.log or ..\Documents\My Games\Fallout4\Logs\Script\User\ if you have configured a user log.

..\Documents\My Games\Fallout 4\Fallout4Custom.ini[edit | edit source]

[Papyrus]
bEnableLogging=1
bEnableTrace=1
bLoadDebugInformation=1
bEnableProfiling=1
sDefaultLogOverlay=Papyrus