LogMate Problems after TS2016 upgrade

For all other chatting you want to do and that does not fit in another forum you can use this one.

Re: LogMate Problems after TS2016 upgrade

Postby newbouy » Mon Jul 11, 2016 9:06 pm

AndiS wrote:I have never seen a double forward slash. Double blackslash would be logical as \\ really just means \, because \ normally introduces a sequence like \n.

One thing I remember is that it did not work when the folder to contain the log file did not exist. No idea whether that would have some bearing here.


I dont get it :shock: ive just reverted back to using a single forward slash and now its working ok i must of done something wrong in the early stages of trying it.It even recreates the file if you delete it.I also tried to create the log file in my developer source folder like below but it doesnt work.Looks like it will only create the file if its inside the "Assets" folder.
Code: Select all
logfile = io.open("Source/Newbouy/Debug_Logs/logfile.txt", "a")


Regarding double slash`s heres a snip-it of Rudolf Heijink`s script which lead me to try the double slash idea.
Code: Select all
scriptpath=".\\assets\\RudolfJan\\luadev\\"
dofile(scriptpath .. "common.lua")
dofile(scriptpath .. "debug.lua")
mydebug=DebugTS.new()
dofile(scriptpath .. "Guard.lua")


AndiS wrote:I use Crimson and Notepad++ and both tell you that the file has been modified but you have to confirm that.

Thanks for that info i will try that and see how it performs

JamesLit wrote:LM being open will cause TS to crash when it goes from the loading screen into the scenario or editor (route or scenario editor).

If you set the LogMate switch -SetLogFilters="All" and then set the switch -RemoveLogFilters to remove all the tabs that you didnt need you could actually run Logmate easily along side the game.If you just ran LogMate with no switches it would try to monitor everything and cause your PC to grind to a halt.I personally think its a shame they have disabled all of its features ,i seem to remember in the early days you could actually close the tabs you didnt require with a simple mouse click in one of the pull down menus.

Thanks alot Newbouy
newbouy
Full Time Fireman
 
Posts: 52
Joined: Sat Apr 12, 2014 9:29 am
Has thanked: 3 times
Been thanked: 19 times

Re: LogMate Problems after TS2016 upgrade

Postby AndiS » Mon Jul 11, 2016 9:24 pm

No idea about writing outside Assets, I was glad enough to get it working there, back then. :roll:
One could theorise about file permission, but I rarely ever get to finding a second solution once something (finally) started to work.

Same with the slashes. / is Unix notation that was taken over by Windows at some late stage. \ is DOS notation and it has the difficulty that \ is the escape character in many languages, so you normally type \\ to get \. I just try / and if it does not work, \\. That's the donkey mode that works in a lot of languages. :lol:
AndiS
Top Link Driver!
 
Posts: 736
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 268 times
Been thanked: 308 times

Re: LogMate Problems after TS2016 upgrade

Postby newbouy » Tue Jul 12, 2016 4:45 pm

Hello AndiS notepad ++ works fine with update silently and scroll to last line after update set in the options.Only downside is that if the notepad window is not selected it doesnt update so you have to keep moving from the game window to the notepad window which gets abit tedious.Theres proberbly some way of fixing this so will look into it.Dont know if youve got access to Rudolf Heijink`s scripts but ive been looking at them and i see he has made the write to offline file routine into a function.I assume every time the message varible is set to sometime other then nill it triggers the function to sent it to the logfile opened in notepad ++.

thanks newbouy
newbouy
Full Time Fireman
 
Posts: 52
Joined: Sat Apr 12, 2014 9:29 am
Has thanked: 3 times
Been thanked: 19 times

Re: LogMate Problems after TS2016 upgrade

Postby AndiS » Tue Jul 12, 2016 5:04 pm

I run RW in windowed mode while debugging (i.e., always :lol: ) so all that is needed it Alt-TAB once or twice, to switch between RW and Notepad++ or whatever.

I never saw scripts by Rudolf Heijink. If course, I use a ton of functions for the logging. They compose various info pack (read: groups of global variable) and they write various prefixes into the prefix column of the log. But this is just convenience and design.

I never heard of a way to call a function on altering a variable. What some people do is group variables into an object and use functions (then called methods) to access the data. Then, of course, these functions can call the logging function to obtain the effect you observe.

You can certainly add writing a log file line every time Update is called. Just be warned that this makes for a lot of lines. And you can observe changes of variables there, by doing
Code: Select all
if oldValue <> value then
  writelog("The value changed from " .. oldValue .. " to " .. value)
  oldValue = value
end

with function writelog doing the write and flush plus some prefix to tell the time or other stuff.

I spent some time doing such things to plot the speed of AI trains in connection with the location of signal links. Not something I can recommend to others for repetition. Just leaves you depressed.
AndiS
Top Link Driver!
 
Posts: 736
Joined: Wed Apr 09, 2014 5:48 pm
Has thanked: 268 times
Been thanked: 308 times

Previous

Return to General Chat

Who is online

Users browsing this forum: No registered users and 4 guests

cron