When using the GLFW library, for example, a debug context can be created with a single call:
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE);
This is necessary for glDebugMessageCallback to work correctly (I use OpenGL version 4.6 (core profile) without plugging in the sfml-graphics module, defining the sf::ContextSettings myself).
Callback does not work for error level messages, although with GLFW everything works. I suspect that this is due to extensions that need to be plugged in independently (namely GL_KHR_debug). How do I do this correctly? It is very convenient to work with SFML, I would not like to go back to GLFW because of such trifles.