How to log my results for debug ?

Place to get help with not working mods / modding interface.
User avatar
MisterBrownZA
Burner Inserter
Burner Inserter
Posts: 8
Joined: Mon Nov 02, 2015 7:10 am
Contact:

How to log my results for debug ?

Post by MisterBrownZA »

I saw there was a post by a user who used factorio.exe > my.log or something like that...

But since the update, he wasn't able to log his print() anymore.

Has a solution for this problem be found yet ?

What is the best way to investigate a table, real-time ?

It's silly that each individual modder has to investigate the table for themselves. The table data should be documented...
User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: How to log my results for debug ?

Post by prg »

MisterBrownZA wrote:I saw there was a post by a user who used factorio.exe > my.log or something like that...

But since the update, he wasn't able to log his print() anymore.

Has a solution for this problem be found yet ?
Still works fine in 0.12.16 on Linux. Are you able to reproduce this not working on Windows? What's the problem there?
MisterBrownZA wrote:What is the best way to investigate a table, real-time ?
If it's not a game object with only __self in it, print(serpent.block(table))
MisterBrownZA wrote:It's silly that each individual modder has to investigate the table for themselves. The table data should be documented...
Like https://forums.factorio.com/wiki/inde ... ua_objects?
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
User avatar
MisterBrownZA
Burner Inserter
Burner Inserter
Posts: 8
Joined: Mon Nov 02, 2015 7:10 am
Contact:

Re: How to log my results for debug ?

Post by MisterBrownZA »

Hi prg,

thanks for the speedy response.

That's correct. I can't generate a log file using factorio.exe > debug.log.

There's no way for me to currently see a dump of the text.

Anyone know how to replicate this for windows ? Should I be running a dedicated server ?

---------------------

I will try

Code: Select all

print(serpent.block(table))
I tried using

Code: Select all

game.show_message_dialog{text = {event}}
But that expects a string, so I can't interpret a table.

Thanks for the wiki. I was getting very frustrated trying to figure everything out.
ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: How to log my results for debug ?

Post by ratchetfreak »

https://forums.factorio.com/wiki/inde ... write_file

Code: Select all

Game.write_file("MyMod_logOutput.txt", textToLog, true)
User avatar
MisterBrownZA
Burner Inserter
Burner Inserter
Posts: 8
Joined: Mon Nov 02, 2015 7:10 am
Contact:

Re: How to log my results for debug ?

Post by MisterBrownZA »

ratchetfreak wrote:https://forums.factorio.com/wiki/inde ... write_file

Code: Select all

Game.write_file("MyMod_logOutput.txt", textToLog, true)
Thanks for this!

Along with that

print(serpent.block())

I'm ready to debug now! Is there a way I can close this thread ?
daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: How to log my results for debug ?

Post by daniel34 »

MisterBrownZA wrote:I'm ready to debug now! Is there a way I can close this thread ?
We usually keep these threads open, in case someone has still problems with it or changes in the game make the code invalid.
Also, someone might have better ideas or can improve on existing ones.
quick links: log file | graphical issues | wiki
Post Reply

Return to “Modding help”