Commits

Jason R. Coombs committed 2733bfd

Include the channel in the URL if the current channel is currently logged.

  • Participants
  • Parent commits 5027154
  • Tags 1105.7

Comments (0)

Files changed (2)

+1105.7
+======
+
+* Include channel in hyperlink for logs for logged channels.
+
 1105.6
 ======
 

File pmxbot/logging.py

 import traceback
 
 import pytz
+import six
 
 import pmxbot
 from . import storage
 
 @command("logs", doc="Where can one find the logs?")
 def logs(client, event, channel, nick, rest):
-	return pmxbot.config.get('logs URL')
+	base = pmxbot.config.get('logs URL')
+	logged_channel = channel in pmxbot.config.log_channels
+	path = '/channel/' + channel.lstrip('#') if logged_channel else '/'
+	return six.urllib.parse.urljoin(base, path)
 
 @command("log", doc="Enable or disable logging for a channel; use 'please' "
 	"to start logging and 'stop please' to stop.")