# $Id: TODO.txt 262 2006-09-07 16:11:00Z sfsetse $

- implement SECONDS for non-bash shells

- look into traps. exit codes seem to be lost

- enable passing the configuration filename on the source line instead of
  requiring the LOG4SH_CONFIGURATION variable

- DatedFileAppender
DatedFileAppender works in the same manner as the Tomcat FileLogger. Contrary
to DailyRollingFileAppender shipping with log4j, log file names generated by
DatedFileAppender always contain today's date. While this distinction seems
minor, it means you can reliably copy, compress, remove or manipulate a day's
log file shortly after midnight. With the DailyRollingFileAppender, a day's log
file is not renamed until the first message is logged some time after midnight.

- the logger command is now wrapped in a ( exec ) wrapper in case it isn't
  there. an error should be thrown at least the first time it was attempted to
  be used. same goes for mail and trap.

- implement file descriptor functions allocFD and freeFD and replace the hard
  coded FD usage in the log4sh_readProperties and _appender_source functions

- validate that the return_test shell test works under cygwin and solaris. if
  so, remove the "unset" stuff before returns as they aren't needed

- replace usage of __log4sh_tmpDir with a call to _log4sh_getTempDir

- make logger level's case insensitive??

- support netcat for telnet

- support logger for syslog
SyslogAppender
  Facility
    The facilityName parameter must be one of the strings KERN, USER, MAIL, DAEMON, AUTH, SYSLOG, LPR, NEWS, UUCP, CRON, AUTHPRIV, FTP, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. Case is unimportant.
  FacilityPrinting
  SyslogHost

- add more error checking on the appender_*set* functions.  see smtp_setSubject

- add get*ByName functions

- try a `wc -l` in the _log4sh_getArrayLength function

- resolve absolute filename
D=`dirname "$relpath"`
B=`basename "$relpath"`
abspath="`cd \"$D\" 2>/dev/null && pwd || echo \"$D\"`/$B"

- swap stdout and stderr
cmd 3>&1 1>&2 2>&3

- filter stdout and stderror
( ( cmd | ... process stdout ) 3>&1 1>&2 2>&3 ) | \
        ... process stderr 3>&1 1>&2 2>&3

- save stdout, stderr, and both to three files
((./program 2>&1 1>&3 | tee ~/err.txt) 3>&1 1>&2 | tee ~/out.txt) > ~/mix.txt 2>&1

- read from tcp port 13 (date/time)
read d < /dev/tcp/127.0.0.1/13
echo $d

* python like list indexing (see p31 in _Dive Into Python_)
>>> li
['a', 'b', 'new', 'mpilgrim', 'z', 'example', 'new', 'two', 'elements']
>>> li.index("example")
5
>>> li.index("new")
2
>>> li.index("c")
x not in list
>>> "c" in li
False

- research fanout - writing to multiple locations
http://linuxgazette.net/122/TWDT.html#smith

#------------------------------------------------------------------------------
# completed todos
#

- look into something like 'trap ". $HOME/.atexit" 0' for use when log4sh
closes to remove temporary files/dirs

TmpBase=${TMPDIR:=/tmp}/myscript.$$
mkdir "$TmpBase" || exit 1	# create directory
chmod 700 "$TmpBase" || exit 1	# restrict access

# Remove all temporary files after program termination
# or at receiption of a signal:
trap 'rm -rf "$TmpBase" >/dev/null 2>&1' 0
trap "exit 2" 1 2 3 15

# The following files will be remove automatically:
input=$TmpBase/input
output=$TmpBase/output
#...

