'%n' in log pattern broken?

Development of XChat itself. Talk about code, patches and other technical stuff. No feature requests!
Formal bug reports should go to http://xchat.org/cvs/#bugs instead.
This forum is for developers writing xchat code, not end-user questions.

'%n' in log pattern

Postby jlh » 17 Aug 2004 10:35

I log everything and had a problem with the naming of the log files. I use the pattern '%n-%c.log', which worked for some server, but for others it doesn't. For example I'm on irc.p2pchat.net and the %n got correctly replaced with 'P2PChat' for the log files. Other servers, like irc.freenode.net and many others don't work, the %n gets replaced by 'NETWORK' (the default replacement). I know that this isn't xchat's fault, because it's the server that doesn't send out the proper name. But it's a bit a trouble if I'm digging for something in the log files and especially causes a conflict if I'm on two identically named channels on two non-working but different servers, as they will use the same log file. But still, I don't want to use %s in the pattern, because that would create different files every time I connect, because most chat networks consist of several servers.

However, since I use 2.4.0, it doesn't work at all anymore, not even for P2PChat. The server tab still says 'P2PChat' instead of having the server's domain, so the server is still sending its name properly. But now, all the files are called 'NETWORK-*' even the P2PChat ones. Did something break?
jlh
 
Posts: 248
Joined: 14 Jul 2004 19:38
Location: Switzerland

Postby Kyoshiro » 17 Aug 2004 23:46

An idea to solve that issue should be to add %N value, which could correspond to network name in configuration when it's a configured network, or else %n (server's claimed network name).
Kyoshiro
 
Posts: 35
Joined: 07 Jul 2004 23:26

Postby jlh » 18 Aug 2004 01:49

I think '%n' already uses the name from the configuration if the server doesn't send anything. (Someone told me this on #xchat a while ago.) But I didn't check this for 2.4.0. But anyway, I'm never using the server list. I usually type in the /server command myself and will probably write a script to automate it some day.

But at least for the servers that do send out their name, I'd like '%n' to work again, like in 2.0.10.
jlh
 
Posts: 248
Joined: 14 Jul 2004 19:38
Location: Switzerland

Postby peterz » 20 Aug 2004 12:56

%n is the network name from the ServerList window. 2.4.0 no longer uses the 005 NETWORK=xyz from the server. The reason was so that logging isn't buggy. For example, on FreeNode, it would create files:

NETWORK.xchatlog (for the server tab)
FreeNode.#channel (for the channels)

Since the 005 numeric comes well into a connection, it would already start logging _before_ it knew the network name.

So the only reliable way to create proper logfiles was to take the network name from the server list. You can't except this to work correctly if you use /server.
User avatar
peterz
 
Posts: 1035
Joined: 09 Jun 2004 13:51
Location: Australia

Postby jlh » 20 Aug 2004 23:19

Too bad. Ok, then I'll try to get along with the server list. :/

Thanks.
jlh
 
Posts: 248
Joined: 14 Jul 2004 19:38
Location: Switzerland

Postby Kyoshiro » 28 Aug 2004 00:47

Thanks Peter ;)
Kyoshiro
 
Posts: 35
Joined: 07 Jul 2004 23:26


Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest