When to use 'Log' ?

pkdj

New Member
Licensed User
Longtime User
Hi,

I am just starting on the road to App development so please be gentle with me!

I've got everything up and running and created my very first simple app in an amazingly short period of time. Really like B4A.

The 'Log' keyword looks to be very usefull for debugging and fault finding. Does it have any impact on the overall application i.e. speed / storage when loaded on the device?

Once I've delveloped my app should I leave the Log keywords in or delete them (or comment them out)?

Apologies if this is a numpty question but I want to start off using good coding practices.

Thanks

Paul
 

melamoud

Active Member
Licensed User
Longtime User
I'm not deleting / commenting the lig commands when switching to a released build you will need the output to troubleshoot bugs.

Sometimes I comment out logs with long output or ones that frequently been called use judgment

Logs have some impact on your phone but its important to use them.
 
Upvote 0

pkdj

New Member
Licensed User
Longtime User
Thanks

I'm not deleting / commenting the lig commands when switching to a released build you will need the output to troubleshoot bugs.

Sometimes I comment out logs with long output or ones that frequently been called use judgment

Logs have some impact on your phone but its important to use them.

Many thanks

Paul
 
Upvote 0

melamoud

Active Member
Licensed User
Longtime User
Uncheck the "filter logs" option. You will see that many applications send many messages to the logs. The logs are maintained by the OS in a circular buffer. So you do not need to worry about it.

just dont dump a lot of text to the logs, like for example dump a web page you are parsing, it will slow you down a bit but worse it will take a lot of the log buffer that is meant for other apps,

same things goes to put a line in log every second (lets say you have a big loop going over 5000 objects , dont log every line - you might need to do that while developing but comment it out, or put it in some kind of a condition like if _MY_DEBUG_VAR) then ....
 
Upvote 0
Top