Logfile Info

By ReQueST on Jan 24, 2005

Gives certain information about your logfiles.
Says the amount of files, the size, average size.
Keeps track of the biggest log-group.
(Tracks nicks and channels.) Usage: /loginfo [nickname|#channel]
Also shows an little edit called "Process Time" (I just added that out of boredom. Its fun for slower pc's, then it actually said the time it took to look trough all the log files. Faster pc's is mostly 0secs) <-HAVE FUN->

alias loginfo {
  set %process.time $ctime
  /say $findfile($logdir,* $+ $$1 $+ *,0) files found for $iif($chr(35) != $left($$1,1),nick:,channel:) $$1 $+ .
  var %a = $findfile($logdir,* $+ $$1 $+ *,0) 
  while (%a) {
    inc %fsize $file($findfile($logdir,* $+ $$1 $+ *,%a)).size
    if (%a = 1) { 
      say Size for the $findfile($logdir,* $+ $$1 $+ *,0) files: $bytes(%fsize,kb3).suf $+ . (Avg: $bytes($calc(%fsize / $findfile($logdir,* $+ $$1 $+ *,0)),kb3).suf $+ ) 
      if (!%biggest) { set %biggest 12 #na }
      if (%fsize >= $gettok(%biggest,1,32)) { 
        set %biggest %fsize $$1 
        say NEW! Record size: $iif($bytes($gettok(%biggest,1,32),kb).suf,$bytes($gettok(%biggest,1,32),kb).suf,0) $+ , for $iif($chr(35) != $left($gettok(%biggest,2,32),1),nick:,channel:) $iif($gettok(%biggest,2,32),$gettok(%biggest,2,32),n/a) $+ , in $findfile($logdir,* $+ $gettok(%biggest,2,32) $+ *,0) files.
        say Process time took: $duration($calc($ctime - %process.time)) $+ .
      }
      else { 
        say Record size: $iif($bytes($gettok(%biggest,1,32),kb).suf,$bytes($gettok(%biggest,1,32),kb).suf,0) $+ , $iif($left($gettok(%biggest,2,32),1) != $chr(35),nick:,channel:): $iif($gettok(%biggest,2,32),$gettok(%biggest,2,32),n/a) $+ , in $findfile($logdir,* $+ $gettok(%biggest,2,32) $+ *,0) files. 
        say Process time took: $duration($calc($ctime - %process.time)) $+ .
      }
      unset %fsize 
    }
    dec %a
  }
}

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.