I just wanted to post one last update on this topic:

[Changes: The previous /flushlog did not flush the buffer if the main log file hadn't been created yet; it now does. Added an -h switch to hide the results of the /flushlog command.]

Code:
/flushlog [-h] [window]


Code:
/viewlog [window]


Code:
alias flushlog {

  if (-* iswm $1) {
    if (h isin $1) { var %flushlog.hide = $true }
    if ($2 != $null) { var %flush.active = $2 }
    else { var %flush.active = $active }
  }
  else {
    if ($1 != $null) { var %flush.active = $1 }
    else { var %flush.active = $active }
  }

  var %flush.path.1 = $window(%flush.active).logfile
  var %flush.path.target = $gettok($nopath(%flush.path.1), 1, 46)
  var %flush.path.2 = $mklogfn(%flush.path.target)

  var %flush.color = $color(Info Text)

  if ($isfile(%flush.path.1) == $true) {
    .copy -a $qt(%flush.path.1) $qt(%flush.path.2)
    if (!%flushlog.hide) {
      echo %flush.color -atge * Flushed log: %flush.active
    }
    .remove $qt(%flush.path.1)
  }
  else {
    if (!%flushlog.hide) {
      echo %flush.color -atge * /flushlog: file not found
    }
  }
}


Code:
alias viewlog {

  if ($1 != $null) { var %view.active = $1 }
  else { var %view.active = $active }

  var %view.path.1 = $window(%view.active).logfile
  var %view.path.target = $gettok($nopath(%view.path.1), 1, 46)
  var %view.path.2 = $mklogfn(%view.path.target)

  flushlog -h %view.active

  if ($isfile(%view.path.2)) { run $qt(%view.path.2) }
  else { echo $color(Info Text) -agte * /viewlog: file not found }
}