Skip to content

Owain94/Logging

Repository files navigation

Logging

Build Status Greenkeeper badgedependencies Status devDependencies Status Codacy Badge codebeat badge codecov

Add this to ~/.profile

function previous_command_status()
{
    if [ $? -eq 0 ]; then
        ~/logging.sh
    fi
}

PROMPT_COMMAND='previous_command_status'

add this to ~/logging.sh and change the IP address to the IP address of the computer that's running the application

ipaddress="xxx.xxx.xxx.xxx:8000"

last=$1

prev=$(fc -ln -1)

while true; do
  echo -n "Do you want to log this command? [Y/n] "
  read yn
  case $yn in
    [Yy]* ) break;;
    [Nn]* ) exit;;
    * ) exit;;
  esac
done

curl --request POST "http://$ipaddress/api/log/cli" --data "how=$prev" --data --data "with=Terminal"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published