I wrote a script which has two methods one which collects logs and other method which does some operation on the logs collected, so my methods which collects logs is in a while loop and will wait for user to press CTRL+C. As soon as CTRL+C is detected it should start executing another method which does some operation on logs collected.
How do i implement CTRL+C; as detected it should start running another method.