import com.intellij.openapi.diagnostic.Logger; public class MyPlugin { private static final Logger logger = Logger.getInstance(MyPlugin.class); public void someMethod() { logger.warn("Something went wrong"); } }In this example, the warn method is used to log a warning message to the console or log file when something unexpected happens. The package library of this class is com.intellij.openapi.diagnostic, which is part of the IntelliJ IDEA SDK.