mIRC Home    About    Download    Register    News    Help

Print Thread
Timestamps logged for /echo even if -t not used #238489 02/08/12 09:27 PM
Joined: Aug 2012
Posts: 4
S
SneakyTon Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Aug 2012
Posts: 4
Timestamps are still written to logs for /echo even when -t is not specified.

//echo -a $timestamp test
[22:27:10] test

Log:
[22:27:10] [22:27:10] test

Re: Timestamps logged for /echo even if -t not used [Re: SneakyTon] #238490 02/08/12 09:52 PM
Joined: Jul 2006
Posts: 3,755
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,755
That would be because you have the option set to use a timestamp for logs


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Timestamps logged for /echo even if -t not used [Re: SneakyTon] #238491 02/08/12 10:28 PM
Joined: Feb 2006
Posts: 74
G
gbz Offline
Babel fish
Offline
Babel fish
G
Joined: Feb 2006
Posts: 74
The output of $timestamp is always written to logs, so if you have the Timestamp logs option on, you'll get double timestamps as you showed.

/echo -at test will not add the timestamp to the logs, so if you use that you should only see one timestamp in them (or even none at all, with the Timestamp logs option disabled).

Re: Timestamps logged for /echo even if -t not used [Re: gbz] #238493 02/08/12 11:49 PM
Joined: Aug 2012
Posts: 4
S
SneakyTon Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Aug 2012
Posts: 4
Yes, I am aware of that. I'm saying they shouldn't be unless -t is used. Some of us actually need to use our own timestamp, not the current time for certain lines (such as playing back a BNC buffer).

Last edited by SneakyTon; 02/08/12 11:54 PM.
Re: Timestamps logged for /echo even if -t not used [Re: SneakyTon] #238494 03/08/12 12:15 AM
Joined: Feb 2006
Posts: 74
G
gbz Offline
Babel fish
Offline
Babel fish
G
Joined: Feb 2006
Posts: 74
So turn off timestamps for logs and you'll only see your custom one.

Re: Timestamps logged for /echo even if -t not used [Re: SneakyTon] #238500 03/08/12 02:55 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
In short: if you want to use a custom timestamp at the beginning of the line, you MUST do it through the use of -t. mIRC has no other way of identifying if a line begins with a timestamp except by keeping track of where -t is used, which is why it ends up duplicating what, to YOU, seems like a timestamp, but to mIRC is just a single timestamp followed by arbitrary log data. This is not a bug, this is merely an illustration of the fact that the DATA echo'd in /echo -a <DATA HERE> is really just arbitrary data. Whether or not you fill DATA with $timestamp is something mIRC does not know or care about.

FWIW, you could use /timestamp to temporarily set the timestamp format for the line, use /echo -t so that mIRC properly registers the line as being timestamped, and then reset the timestamp to the previous format:

Code:
//var %ts = $timestampfmt | timestamp -f CUSTOMFORMAT | echo -at using custom format | timestamp -f %ts


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: Timestamps logged for /echo even if -t not used [Re: argv0] #238505 03/08/12 11:05 AM
Joined: Aug 2012
Posts: 4
S
SneakyTon Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Aug 2012
Posts: 4
Quote:
In short: if you want to use a custom timestamp at the beginning of the line, you MUST do it through the use of -t.

I'm not changing the format, I'm changing the actual timestamp (to one in the past). I already did say "not the current time".

Quote:
mIRC has no other way of identifying if a line begins with a timestamp except by keeping track of where -t is used, which is why it ends up duplicating what, to YOU, seems like a timestamp, but to mIRC is just a single timestamp followed by arbitrary log data. This is not a bug

I am aware of that. I'd have to say it's a bug, since /echo -t does not give you duplicate timestamps. The reason for not using -t is: you don't want a timestamp, so you probably don't want it in the log either.


Quote:
So turn off timestamps for logs and you'll only see your custom one.

And then I lose all other timestamps. If /echo is used without -t, you don't want a timestamp. So really the timestamp shouldn't be logged.

Re: Timestamps logged for /echo even if -t not used [Re: SneakyTon] #238506 03/08/12 12:27 PM
Joined: Jan 2004
Posts: 1,318
L
Loki12583 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,318
Omitting -t in /echo is not an indication that you don't want the timestamp logged. It's an indication that you don't want it displayed. Displaying it and logging it are different functions.

Re: Timestamps logged for /echo even if -t not used [Re: SneakyTon] #238508 03/08/12 04:38 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Although I've run into the double timestamp problem myself, it's more of a scripting issue than a bug in mIRC. As mentioned, text after the echo can be anything and mIRC has no way to know if it's a timestamp. In most cases, you can easily put whatever you want into the timestamp format and then use -t.

That being said, adding a feature suggestion to add a switch to prevent timestamping an echo line might not be a bad idea. There are times when you might not want an echo timestamped even if you want the rest timestamped and having a way to do that without changing the format would be a good thing. Especially if you don't want to change the timestamp on everything else coming through at the time that you're doing the echo. After all, changing the timestamp format for a line and changing it back can result in other items getting that temporary timestamp if they come in at the right time and that's not necessarily a good thing.

This is not something most people will run into, but having that switch would be useful in specific situations, imo.


Invision Support
#Invision on irc.irchighway.net
Re: Timestamps logged for /echo even if -t not used [Re: SneakyTon] #238513 03/08/12 08:55 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Originally Posted By: SneakyTon
I'm not changing the format, I'm changing the actual timestamp (to one in the past). I already did say "not the current time".


The format and the actual timestamp are the same things. You can change the format to be an actual time:

Code:
//var %ts = $timestampfmt | timestamp -f [01:25] | echo -at this will be displayed at 1:25AM. | timestamp -f %ts


Rather than stubbornly assuming you are right, you should ask how these features could be used to do what you want, if you can't immediately see how. We would gladly show you (as I just did).

And again, it's not a bug. At best it's a limitation. mIRC has no way of detecting that you are putting a custom timestamp in the line. When you timestamp logs, mIRC timestamps all lines that come in-- this is a logging feature, not a display feature. The whole point of the feature is so that users have the time associated with each logged line, you know, as log files typically do. It absolutely should timestamp every line regardless of whether -t is used (-t being a special case where mIRC strips the first token)-- because if someone turns timestamps off in display but turns it on in logging, they should get timestamped logfiles. With your suggestion, this would not work.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: Timestamps logged for /echo even if -t not used [Re: argv0] #238515 04/08/12 02:48 AM
Joined: Aug 2012
Posts: 4
S
SneakyTon Offline OP
Self-satisified door
OP Offline
Self-satisified door
S
Joined: Aug 2012
Posts: 4
Quote:
The format and the actual timestamp are the same things. You can change the format to be an actual time

Which would then change other lines that are output before the format is reset. So that would result in having to repeatedly change and reset the format.

Quote:
mIRC has no way of detecting that you are putting a custom timestamp in the line.

Never said it did. A separate /echo flag to not log the timestamp would work.

Re: Timestamps logged for /echo even if -t not used [Re: SneakyTon] #238517 04/08/12 09:09 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Originally Posted By: SneakyTon
Which would then change other lines that are output before the format is reset. So that would result in having to repeatedly change and reset the format.


Again, I provided the code that echos the line and resets the format-- so yes, you have to repeatedly change the format, I already showed this in my example, but this is irrelevant for two reasons:

1) Presumably, each "actual time" is different from the last, so you HAVE to change the timestamp format for each line no matter what.

2) You don't need to reset to the original $timestampfmt until the end of the set of lines (if you echo more than one at a time), though. My example echo's a single line, but you would loop /timestamp -f and /echo -at continuously. mIRC is single-threaded-- you can guarantee that no other code will execute while your buffer loading operation is being performed.

There shouldn't be any performance issues with doing this, by the way-- /timestamp -f does a very simple memory manipulation. Resetting the timestamp format won't do any harm.

Originally Posted By: SneakyTon
Never said it did. A separate /echo flag to not log the timestamp would work.


Then you are asking for a new feature, not reporting a bug. Again-- this behaviour is intentional and not a bug, but if you want a NEW switch in /echo to bypass to forcibly disable timestamp logging for a line, feel free to suggest it in the Feature Suggestions forum.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"