Difference between revisions of "Enable Debug Logging"

276 bytes added ,  23:45, 1 August 2016
Added some style, changed some wording, and fixed wiki links
imported>Qazaaq
(spelling category)
imported>Qazaaq
(Added some style, changed some wording, and fixed wiki links)
Line 1: Line 1:
[[Category:Tutorial_Stubs]]
[[Category:Tutorial_Stubs]]
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.


  Debug.Trace("I'm logged as an INFO message")
<source lang="papyrus">
  Debug.Trace("I'm logged as a WARNING message",1)
  Debug.Trace("This message is written to the papyrus log file.")
  Debug.Trace("I'm logged as an ERROR message",0)
  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)
  Debug.DumpEventRegistrations(self)
</source>


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


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


'''NOTE:''' Log output from Fallout 4 will be written to <Documents>\My Games\Fallout 4\Logs\Script\
'''NOTE'''  
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.
Anonymous user