Jump to content

Archived

This topic is now archived and is closed to further replies.

chain

Log Viewer

Recommended Posts

  • Administrators

Log Viewer

 

logo.jpg

 

This will open a @window listing all your .log files in a side list box. By double clicking the one you will then see what is in it in the main part of the @window. Also by chosing "Stats" in the @window menu it will tell you how many .log files you have. The title of the @window changes to let you know which one you are viewing and for which network.

 

Original idea and basis from http://www.hawkee.com/snippet/8441/ I edited it a bit and made some modifications and felt I would share it.

 

Update: Added search feature for Display area and List area. Added a reset feature for Display area and List area.

 

Update 23May2011: Added ability to delete log files ( send to Recycle Bin ) , fixed a bug and cleaned a bit of the code.

 

**Note: This was written on version 6.35

 

menu status,channel { 

  Log Viewer: log.viewer

}

alias log.viewer {

  $iif(!$window(@LogViewer),window -CkSzl18 @LogViewer $mircexe)

  dline @LogViewer $+(1-,$line(@LogViewer,0,0))

  dline -l @LogViewer $+(1-,$line(@LogViewer,0,1))

  renwin @LogViewer @LogViewer $chr(160)

  noop $qt($findfile($logdir,*.log,@LogViewer,aline -l @LogViewer $nopath($1-)))

}

menu @LogViewer {

  dclick {

    if ($sline(@LogViewer,1)) { 

      renwin @LogViewer @LogViewer $& 

        - Log File: $gettok($sline(@LogViewer,1),1,46) $&

        - Network: $gettok($sline(@LogViewer,1),2,46) $&

        - Size: $bytes($file($qt($findfile($logdir,$sline(@LogViewer,1),1))).size).suf

      .loadbuf -rip @LogViewer $qt($findfile($logdir,* $+ $sline(@LogViewer,1) $+ *,1)) 0

    }

  }

  Delete Log: { 

    if ($input(Want to delete $sline(@LogViewer,1),uy,Log File Delete)) {  

      if ($input(Are you sure you want to delete $sline(@LogViewer,1),y,Log File Delete Confirming)) { 

        .remove -b $qt($+($logdir,$sline(@LogViewer,1)))

        noop $input(Moving $sline(@LogViewer,1) to Recycle Bin.,ok2,Log File Delete Confirmation)

        log.viewer

      }

    }

  }

  Reset:

  .Display: { dline @LogViewer $+(1-,$line(@LogViewer,0,0)) | renwin @LogViewer @LogViewer $chr(160) }

  .List: { log.viewer }

  Search: 

  .Display: { $LogViewerSearch($remove($$?="Search term",$chr(32)),D) }

  .List: { $LogViewerSearch($remove($$?="Search term",$chr(32)),L) }

  Stats { 

    dline @LogViewer $+(1-,$line(@LogViewer,0,0)) | renwin @LogViewer @LogViewer $chr(160)

    echo -a 12[!]4 There are currently 12 $+ $findfile($logdir,*.log,0) 4log files 12[!]

  }

}

alias -l LogViewerSearch { 

  if ($1 && $isid) {

    if ($2 = D) {

      window -znk0 @LogViewerSearch $mircexe

      filter -wwcpz @LogViewer @LogViewerSearch * $+ $1 $+ *

      renwin @LogViewerSearch @LogViewerSearch $& 

        - Log File: $gettok($sline(@LogViewer,1),1,46) $&

        - Network: $gettok($sline(@LogViewer,1),2,46) $&

        - Search Term: $1

      if ($filtered 

Link to comment
Share on other sites



×
×
  • Create New...