Difference between revisions of "Enable Debug Logging"

98 bytes added ,  11:38, 29 August 2019
Added categories, change format.
imported>Qazaaq
(Added some style, changed some wording, and fixed wiki links)
imported>Qazaaq
(Added categories, change format.)
Line 1: Line 1:
[[Category:Tutorial_Stubs]]
The [[Debug Script]] offers many methods for diagnosing and tracing execution of [[Papyrus]] scripts.
The [[Debug Script]] offers many methods for diagnosing and tracing execution of [[Papyrus]] scripts.  
 
The following are some of the most commonly used.
The following are some of the most commonly used.
<source lang="papyrus">
<source lang="papyrus">
Debug.Trace("This message is written to the papyrus log file.")
Debug.Trace("This message is written to the papyrus log file.")
Debug.Notification("This message is displayed on the HUD menu.")
Debug.Notification("This message is displayed on the HUD menu.")
Debug.MessageBox("This message is displayed in a message box.")
Debug.MessageBox("This message is displayed in a message box.")
Debug.CenterOnCell("QASmoke")
Debug.CenterOnCell("QASmoke")
Debug.DumpEventRegistrations(self)
Debug.DumpEventRegistrations(self)
</source>
</source>




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\Fallout 4\Fallout4Custom.ini</code>".
# Populate the <code>Fallout4Custom.ini</code> file with the following settings.


# Open the file :  <code>..\Documents\My Games\Fallout 4\Fallout4Custom.ini</code>
Log output from [[Papyrus]] will be written to <code>..\Documents\My Games\Fallout 4\Logs\Script\Papyrus.0.log</code> or <code>..\Documents\My Games\Fallout 4\Logs\Script\User\</code> if you have configured a user log.
# Populate the Fallout4Custom.ini file with the following:
 
<source lang="text">
==== ..\Documents\My Games\Fallout 4\Fallout4Custom.ini ====
[Papyrus]
<source lang="ini">
bEnableLogging=1
[Papyrus]
bEnableTrace=1
bEnableLogging=1
bLoadDebugInformation=1
bEnableTrace=1
bEnableProfiling=1
bLoadDebugInformation=1
sDefaultLogOverlay=Papyrus
bEnableProfiling=1
sDefaultLogOverlay=Papyrus
</source>
</source>




'''NOTE'''
[[Category:Game Configuration]]
Log output from [[Papyrus]] will be written to <code>..\Documents\My Games\Fallout 4\Logs\Script\Papyrus.0.log</code> or <code>..\Documents\My Games\Fallout 4\Logs\Script\User\</code> if you have configured a user log.
[[Category:Papyrus Configuration]]
Anonymous user