How do I write a logfile

Get help using Construct 2

Post » Sat Apr 16, 2016 7:43 am

Hey guys

I want to create a logfile (.txt or something) to have a look what's going on and for debug purposes. How can I do that in the simplest way if anyhow.

Thanks
B
5
Posts: 6
Reputation: 237

Post » Sat Apr 16, 2016 8:01 am

Hi elbando,

if you dont need to download it (if its ok for you to get the log-output into a textbox (multiline) where you can copy&pasta it somewhere else):

Image

1 multiline TextBox is needed for that. Call your "Debug"- function and give it a parameter (Param(0) in my exmaple); for example:

Code: Select all
"RandomValue: " & aRandomValue


Thats the way Im logging stuff in my projects.

Have a great weekend,
Proxy
B
24
S
14
G
9
Posts: 118
Reputation: 6,799

Post » Sat Apr 16, 2016 9:19 am

@Proxymity Thank you for your answer! I'll do it that way now, works fine. But out of curiosity: Would it be possible to write that into a .txt file?
B
5
Posts: 6
Reputation: 237

Post » Sat Apr 16, 2016 10:04 am

elbando wrote:@Proxymity Thank you for your answer! I'll do it that way now, works fine. But out of curiosity: Would it be possible to write that into a .txt file?


Glad I could help ;-)

Hmm.. lets say: there has to be a way to download a *.txt file. Personally I didnt needed that before, so I cant tell you exactly how to :?:

But what I sure can say is, that you could modify the "WriteLog" function to additi-break- while writing this I took a look at the browser manual, maybe the "Invoke download of string" or "Invoke download" will fit your needs (https://www.scirra.com/manual/110/browser).
B
24
S
14
G
9
Posts: 118
Reputation: 6,799

Post » Sun Apr 17, 2016 8:41 pm

@Proximity Thank you again, that link helped a lot. I don't need necessarily a .txt file. Now I'm using the log function from the Browser plugin. That's even better for debugging purposes in my case.

Have a nice week.
B
5
Posts: 6
Reputation: 237


Return to How do I....?

Who is online

Users browsing this forum: Fradno and 17 guests