serilog-sinks-richtextbox icon indicating copy to clipboard operation
serilog-sinks-richtextbox copied to clipboard

Add ability to convert URLs to clickable HyperLinks

Open augustoproiete opened this issue 4 years ago • 1 comments

Discussed in https://github.com/serilog-contrib/serilog-sinks-richtextbox/issues/11#issuecomment-912642600

Originally posted by TonyValenti September 3, 2021 If a URL is logged, please convert it to a clickable HyperLink

augustoproiete avatar Sep 04 '21 17:09 augustoproiete

Some initial thoughts:

  • Enabled by default with option to turn off, or Disabled by default with option to turn on?
  • Should URLs in message templates be automatically converted to hyperlinks? e.g. Log.Information("Site: https://serilog.net")?
  • Should URLs in properties be automatically converted to hyperlinks? e.g. Log.Information("Site: {url}", "https://serilog.net")?
  • Should we create a new format type where the user can opt-in to formatting as hyperlink? e.g. Log.Information("Site: {url:hyperlink}", "https://serilog.net")?
  • Depending on the answers above, should we scan every log message _after rendering and perform the conversion, or should we inspect message template and properties separately?
  • Should we also scan for email addresses and convert to a hyperlink with mailto:?
  • Should we also scan for file paths and convert to a hyperlink with file://?
  • What would be a good interface to allow users to apply a custom logic to detect/replace hyperlinks (intercept or passthrough)?

augustoproiete avatar Sep 04 '21 17:09 augustoproiete