Does anyone know where lua's "print" function writes to? I don't see it on screen, nor do I see it in the log file. I'm working on a mod, so "game.player.print" doesn't work yet. Is there a way to direct it to a file? That would work for me.
Thanks!
[edit] see post 4 for a workaround/answer.
[answered] Where does lua's print function output go?
-
- Long Handed Inserter
- Posts: 66
- Joined: Sat May 10, 2014 8:48 am
- Contact:
[answered] Where does lua's print function output go?
Last edited by Flux Faraday on Sat Feb 14, 2015 8:17 am, edited 1 time in total.
Re: Where does lua's print function output go?
I think there currently are no ways of getting any kind of text output from code that gets run from data.lua (or data-updates.lua or data-final-fixes.lua). In code ran from control.lua you can use makefile to make log file: https://forums.factorio.com/wiki/inde ... e#makefile
Re: Where does lua's print function output go?
On linux and mac os x it prints to terminal (stdout).
On windows, I'm afraid, it prints to non-existent console and you can't capture this output.
On windows, I'm afraid, it prints to non-existent console and you can't capture this output.
-
- Long Handed Inserter
- Posts: 66
- Joined: Sat May 10, 2014 8:48 am
- Contact:
Re: Where does lua's print function output go?
Thanks for this!! All I have to do to fix this is make the console exist. So, in Windows, start a "cmd" window, navigate to Factorio's x64 directory, run Factorio asXecutor wrote:On linux and mac os x it prints to terminal (stdout).
On windows, I'm afraid, it prints to non-existent console and you can't capture this output.
Code: Select all
.\Factorio.exe > junk.log
Re: [answered] Where does lua's print function output go?
Flux Faraday's is the best solution, but if you just want something quick and dirty I often use error(serpent.block(something)) to make Factorio show me the value of something in an error dialog 
