Logging data to a file

mc73

Well-Known Member
Licensed User
Longtime User
I am planning to add a logging subroutine, which will write variables, etc, to a file. Now, since I know there's going to be a rather big data output (I estimate it around 100mb or a bit more) I was wondering whether it is appropriate to use randomAccess. Thank you.
 

derez

Expert
Licensed User
Longtime User
To write it to randomaccess file is not a problem but the question is if you will know how long each variable is and where to put the pointer for reading the data later. If the logged data is with the same length every write then the reading is simple, but when the length vary - it may be a problem, you'll need to store for each write operation the length, then read first the length and then the data.
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
Thank you for your reply. Actually, I will not bother with an automatic type of reading. I will simply upload the file to a pc-editor, then filter for some specific variables the behavior of which I'm suspicious of. Thus, if size matters not, I guess it will be fine! Thanks once again.
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
Still, any chance that I can easily log ALL variables without bothering to do it manually? I mean, create a small routine which somehow will write all activities' variables at once.
 
Upvote 0

derez

Expert
Licensed User
Longtime User
I think that you can put all variables into one object (create a type with all variable) and then use
raf.WriteObject(.....)
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
I think that you can put all variables into one object (create a type with all variable) and then use
raf.WriteObject(.....)
thanks once again! it's just too many of them.anyway, I'll give it a try :)
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
Done it the 'hard' way, by copy-pasting all dimmed variables in globals and process_globals, since their values I wanted. Thank you for your notes!
 
Upvote 0
Top