Game Development Reference
In-Depth Information
Line 45 : The WriteLine method of StreamWriter is called to print textual
data to the logfile when an error occurs. The error information is provided
by Unity through the HandleLog arguments: logString , stackTrace , and
LogType . The StreamWriter class is part of the Mono Framework, which
is an open source implementation of the Microsoft NET Framework. More
information on StreamWriter can be found at http://msdn.microsoft.
com/en-us/library/system.io.streamwriter%28v=vs.110%29.aspx .
One of the quickest ways to test out your error logger is to
create a divide by zero error. Don't forget to insert a Debug.Log
(Application.persistentDataPath); line somewhere in your
code to print the logfile path to the Console window. This can help
you quickly find the logfile on your system via Windows Explorer or
Mac Finder. Note that the persistentDataPath variable is used as
opposed to an absolute path, because it varies from operating system to
operating system.
The following screenshot shows how to print errors to a text-based logfile:
Printing errors to a text-based logfile can make debugging and bug fixing easier
 
Search WWH ::




Custom Search