This one for private msg windows
Code:
on *^:open:?:*:query -n $nick | echo -gce info $nick * Logging: $iif($window($nick).logfile,$v1,Off)

This for channels
Code:
on me:^*:join:#:echo -gce info # * Logging: $iif($window(#).logfile,$v1,Off)


The 'g' switch tells mIRC not to log that line.