How to log certain information

If I wanted to log certain bits of information in a menu how would I do it.
If I wanted to log each time a person clicked a button including the time/person who clicked the button.

Just some pseudo code since I have nothing to base this off of:

[lua]onButtonPress(function()
file.Append(“mylog.txt”, “Button was pressed/n”)
end)[/lua]

That might point you in the right direction. If you’re looking for more detail you have to give us more than just “a log when a button is pressed”

Okay well then to be more precise. I want these logs to draw out nicely across a DFrame.
Log who issued the press. Along with what time they issued the press. That’s about it.
I’ll figure out the rest on my own.

Log who issued the press?

LocalPlayer
Log when they issued it?

os.time

If you want to put it nicely in a DFrame, just use any table-to-string and string-to-table functions you want to add the data to the text file, then load it and convert it to a table, then use that table to create the vgui elements needed. Simple.