B4J Question [Solved] Don't want to include link to line in log file

bdunkleysmith

Active Member
Licensed User
Longtime User
It has been a standard feature of my apps to write a "log" file for diagnostic purposes when others using my app encounter problems.

However with the inclusion of the feature associated with the log function which provides a link to the line containing the log statement, the log text file looks a little messy.

So for a series of log outputs viewed in the IDE:

1679400629501.png


the resultant text log file looks like:

~l0465569:Java version: 18.0.1

~l0465571:Host Address: 192.168.0.10

~l04131191:read:stream_persons

~l04131191:read:stream_statistics

~l04131191:read:stream_statistics_catchup

~l04131191:read:stream_persons_catchup

~l04131191:read:stream_externals_catchup

~l04131191:read:stream_catchup_summary

~l04131191:read:response

Is there a way to write a log file which doesn't contain those line references as a prefix and the extra line feed?
 

DonManfred

Expert
Licensed User
Longtime User
Is there a way to write a log file which doesn't contain those line references as a prefix and the extra line feed?
Yes, sure. Do not rely on LOG (and even a redirected LOG-Output).
Write your own Logging mechanism; you can add, or not add anything you want.
 
Upvote 0

bdunkleysmith

Active Member
Licensed User
Longtime User
Thanks @DonManfred, but for my purpose I think I'd rather just accept the "messy" output from the simple and convenient approach of redirecting the log output than write my own logging mechanism.

However, if someone could point me to a reference in the Forum where someone has already done that, I'd certainly take a look at it.
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Upvote 1
Solution

bdunkleysmith

Active Member
Licensed User
Longtime User
Thank you @OliverA. I was obviously not thorough enough in my searching.

Indeed adding

B4X:
#VirtualMachineArgs: -Db4j.simplelogs=true

suppresses them while running the program from the IDE and as you say, they won't be there when running the executable.
 
Upvote 0
Top