TinTin++ Mud Client The TinTin++ message board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
TinTin++ Mud Client

Timestamps

 
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Feature Requests
View previous topic :: View next topic  
Author Message
Quackers



Joined: 22 Mar 2008
Posts: 31

PostPosted: Thu Apr 03, 2008 2:54 pm    Post subject: Timestamps Reply with quote

I'd like to see tintin have the ability to timestamp text in the scrollback buffer and in logs. (And yes, I can come up with a kludge to timestamp anything being logged.)

I'd like to be able to type "#config timestamp on" then #grep something (or page through the scrollback) and have the output prepended with timestamps for each line. Then "#config timestamp off" to return to normal behavior. This approach would easily allow logfiles to have timestamps as well. Ideally, some variable like $timestampformat would allow a user to customize the date/time display.

Code:

#config timestamp on
#grep tell

############################ GREP tell ############################
[12:50:43 PM] Nathan Explosion tells you, 'Timestamps are intense.'
###################################################################

#config timestamp off
#grep tell

############################ GREP tell ############################
Nathan Explosion tells you, 'Timestamps are intense.'
###################################################################
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3274

PostPosted: Thu Apr 03, 2008 4:29 pm    Post subject: Reply with quote

I'm kind of on the fense about this one.

I'll look into adding an event that triggers on each received line. That'd at least make creating a custom logging script easier.
Back to top
View user's profile Send private message Send e-mail
moebius



Joined: 27 Jan 2005
Posts: 96

PostPosted: Sun Nov 09, 2008 9:37 pm    Post subject: Reply with quote

I'd really like to see this too. You really lose a lot of information when reading a log or scrollback when you don't know what lines arrived at the same time.
_________________
StrangeMUD - strangemud.net:9332
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3274

PostPosted: Sun Nov 09, 2008 11:23 pm    Post subject: Reply with quote

Following will work the next release:

Code:

#event {RECEIVED LINE}
{
        #format time %T;
        #format result {%t-%m} {{$time} {$time % 60}};
        #line log mylog.txt {<178>$result \};
        #line log mylog.txt
}


Doesn't work with #grep, but currently the scrollback buffer is hashed (which can save a lot of memory) which isn't possible with timestamps.


Last edited by Scandum on Fri Nov 21, 2008 10:05 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
moebius



Joined: 27 Jan 2005
Posts: 96

PostPosted: Thu Nov 20, 2008 10:56 pm    Post subject: Reply with quote

Won't that just log timestamps to a separate file? I'm looking for timestamps on your normal log file.
_________________
StrangeMUD - strangemud.net:9332
Back to top
View user's profile Send private message
Scandum
Site Admin


Joined: 03 Dec 2004
Posts: 3274

PostPosted: Fri Nov 21, 2008 10:44 am    Post subject: Reply with quote

Guess I can make it a hidden config option where it's disabled if left blank, and enabled if you enter a timestamp format.
Back to top
View user's profile Send private message Send e-mail
moebius



Joined: 27 Jan 2005
Posts: 96

PostPosted: Fri Nov 21, 2008 3:08 pm    Post subject: Reply with quote

That's more of what i was hoping for. Something like

Code:
#CONFIG log_timestamp "%Y-%m-%d %H:%M:%S"

(standard /bin/date formatting options)

Then your log shows:

Quote:
2008-11-20 13:01:00 You nod.
2008-11-20 13:01:00 >
2008-11-20 13:01:04
2008-11-20 13:01:04 Fred walks into the room.
2008-11-20 13:01:04 >
2008-11-20 13:02:25
2008-11-20 13:02:25 Fred leaves.
2008-11-20 13:02:26
2008-11-20 13:02:26 You say 'Hey Fred!'
2008-11-20 13:02:26 >
2008-11-20 13:02:28
2008-11-20 13:02:28 Joe laughs.
2008-11-20 13:02:28 >
2008-11-20 13:02:31
2008-11-20 13:02:31 Joe says, 'just missed him! Smile'


Then by default you could have the timestamp format be "" and the output would be same as it is now.
_________________
StrangeMUD - strangemud.net:9332
Back to top
View user's profile Send private message
tarryn



Joined: 06 Jun 2009
Posts: 2

PostPosted: Sat Jun 06, 2009 4:50 pm    Post subject: Reply with quote

This pretty easily accomplished with something like this: (slight variation on Scandum's version)

Prerequisite: capture the name of your current log file in a variable ($logfile).

Then create an event like this:
Code:
#event {RECEIVED LINE}
{
   #format totalmicrosec %U;
   #math microsec {($totalmicrosec % 1000000) / 100};
   #format timestamp {%t.%%04d} {{%H:%M:%S} {$microsec}};
   #line log {$logfile} {$timestamp \};
}


which will prefix "HH:MM:SS.mmmm " before every log line.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The TinTin++ message board Forum Index -> Feature Requests All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads Get TinTin++ Mud Client at SourceForge.net. Fast, secure and Free Open Source software downloads
TinTin++ Homepage

Powered by phpBB © 2001, 2002 phpBB Group