LogiCode: an LLM-Driven Framework for Logical Anomaly Detection