mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2012
Posts: 4
S
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

Joined: Jul 2006
Posts: 4,144
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,144
That would be because you have the option set to use a timestamp for logs


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
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).

Joined: Aug 2012
Posts: 4
S
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.
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.

Joined: Oct 2003
Posts: 3,918
A
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"
Joined: Aug 2012
Posts: 4
S
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.

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
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.

Joined: Oct 2004
Posts: 8,330
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
Joined: Oct 2003
Posts: 3,918
A
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"
Joined: Aug 2012
Posts: 4
S
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.

Joined: Oct 2003
Posts: 3,918
A
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"

Link Copied to Clipboard