SpazmoJones Posted July 2, 2015 Share Posted July 2, 2015 Does anyone know how to force the game to flush its log file? I'm using the LogInternal function which writes to the "..\My Games\XCOM - Enemy Within\XComGame\Logs\Launch.log" file, like this: E7 1F <%t "Log message!"> 2A 16 The problem is this file only gets updated once the game has been closed. I'd like to be able to view the "current" log file while the game is running without having to quit all the way out to see if something worked or not. Is this possible? Link to comment Share on other sites More sharing options...
tracktwo Posted July 2, 2015 Share Posted July 2, 2015 It might not really be easy, it could be the underlying system doing the buffering and you'd need native code to disable the crt buffering if that's the case. On Mac/Linux you could try putting a newline in the string, but that probably won't work for windows. You could also write a bunch of junk to the log to fill the buffer and cause a flush, but that might be hard to read. Link to comment Share on other sites More sharing options...
SpazmoJones Posted July 3, 2015 Author Share Posted July 3, 2015 It might not really be easy, it could be the underlying system doing the buffering and you'd need native code to disable the crt buffering if that's the case. On Mac/Linux you could try putting a newline in the string, but that probably won't work for windows. You could also write a bunch of junk to the log to fill the buffer and cause a flush, but that might be hard to read. Thanks for the tip. I found that I had to write at least 4K at a time to get the data on the disk. I'm using this log file in my new "music" replacement mod http://www.nexusmods.com/xcom/mods/584/ I hope this 4K thing works on other PCs too, not just mine... :) Link to comment Share on other sites More sharing options...
tracktwo Posted July 3, 2015 Share Posted July 3, 2015 Sounds about right. That's likely the default buffer size in the MS CRT and it won't be system-dependent. Glad it works! Link to comment Share on other sites More sharing options...
Drakous79 Posted January 5, 2016 Share Posted January 5, 2016 (edited) I am sorry to dig up old thread, but you can see LogInternal function's output in log's window. Just put -log switch into launch options of the game (Steam / Library / right click on XCOM: Enemy Uknown and select Properties / General Tab, Set Launch Options button). Edited January 5, 2016 by Drakous79 Link to comment Share on other sites More sharing options...
Recommended Posts