Enhanced stack trace slicing in Logger.py