Kevvvvyp
Kevvvvyp

Reputation: 1774

Output to several log files? (Unity3D)

I have a Unity Standalone executable called "MyGame.exe".

I have a script that launches several instances of MyGame.exe with various command line parameters. It looks something like:

 ./MyGame.exe -Name "Player1" 
 ./MyGame.exe -Name "Player2"

My problem is that all output from each game is written to the the one log file found in the MyGame_data folder beside the executable.

Is there anyway I can have each game's output in it's own separate log file?

Upvotes: 1

Views: 1397

Answers (1)

Nain
Nain

Reputation: 1222

According to unity documentation you can change log file path as command line argument while launching your game. so in your script which launch multiple instances you can specify a different path for each instance by

-logFile <pathname> 

argument. So you can try to do something like this"

./MyGame.exe -Name "Player1" -logFile <pathname1>
./MyGame.exe -Name "Player2" -logFile <pathname2>

This will save the outPut on in different files. Hope this solution solve your problem you can get details about this on unity documentation http://docs.unity3d.com/Manual/CommandLineArguments.html under the options heading.

Upvotes: 5

Related Questions