Difference between revisions of "TraceUser - Debug"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Rhavlovick
m (1 revision: Clobber re-import by Henning)
 
imported>JLundin
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
[[Category:Scripting]]
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:Papyrus]]
[[Category:Non-delayed Native Function]]
'''Member of:''' [[Debug Script]]
'''Member of:''' [[Debug Script]]


Line 26: Line 27:
<source lang="papyrus">
<source lang="papyrus">
; Outputs "Hello World" to the "myUserLog" log
; Outputs "Hello World" to the "myUserLog" log
Debug.TraceStack("myUserLog", "Hello World")
Debug.TraceUser("myUserLog", "Hello World")
</source>
</source>
<br/>
<br/>
<source lang="papyrus">
<source lang="papyrus">
; Outputs "Houston, we have a problem" to the "myUserLog" log at error severity (colored red)
; Outputs "Houston, we have a problem" to the "myUserLog" log at error severity (colored red)
Debug.TraceStack("myUserLog", "Houston, we have a problem", 2)
Debug.TraceUser("myUserLog", "Houston, we have a problem", 2)
</source>
</source>



Latest revision as of 08:09, 12 September 2012

Member of: Debug Script

Outputs a string to the specified user log on disk, and the Papyrus debug text page. Returns true if the text was successfully output to the log.

Syntax[edit | edit source]

bool Function TraceUser(string asUserLog, string asTextToPrint, int aiSeverity = 0) native global

Parameters[edit | edit source]

  • asUserLog: The name of the user log to output to, case-insensitive. The log must be open.
  • asTextToPrint: The text that should be printed to the log and text page.
  • aiSeverity: The severity of the trace statement. Info, the default, will show up as green; warnings will show up as yellow; and errors as red; in the Papyrus debug text page.
    • Default: 0 (Info)
    • The following values are acceptable:
      • 0: Info
      • 1: Warning
      • 2: Error

Return Value[edit | edit source]

True if the message was successfully logged. False on failure (usually you forgot to open the log).

Examples[edit | edit source]

; Outputs "Hello World" to the "myUserLog" log
Debug.TraceUser("myUserLog", "Hello World")


; Outputs "Houston, we have a problem" to the "myUserLog" log at error severity (colored red)
Debug.TraceUser("myUserLog", "Houston, we have a problem", 2)

See Also[edit | edit source]