Jump to content

Logging


Erelei

Recommended Posts

  • Implementor

Add this to your script init .tin file:

#event {SESSION CONNECTED} {
        #script {logFilePath} {date +'logs/%Y/%B/%d/'};
        #script {logFileName} {date +'%I_%M%p.log'};
        #system {mkdir -p ${logFilePath[1]}};
        #log {overwrite} {${logFilePath[1]}${logFileName[1]}}
}

This will create logs with the following setup:
 

[:~/tintin/scripts] $ cd logs
[:~/tintin/scripts/logs] $ ls
2014  2015  2016  2017
[:~/tintin/scripts/logs] $ cd 2017
[:~/tintin/scripts/logs/2017] $ ls
August  February  January  June  March  November  September
[:~/tintin/scripts/logs/2017] $ cd November
[:~/tintin/scripts/logs/2017/November] $ ls
01
[:~/tintin/scripts/logs/2017/November] $ cd 01
[:~/tintin/scripts/logs/2017/November/01] $ ls
01_49AM.log  01_53AM.log
[:~/tintin/scripts/logs/2017/November/01] $ 

If you are using wintin, this will have to be modified to use windows folder creation commands and directory posix.

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...