
It specifies that there should be a platform-specific implementation of an object that conforms to the Logger interface, provided by Ktor:

Here is the expected definition of a platform-specific HTTP request / response logger.

Let’s take a look at how we can use the expect/actual mechanism to implement logging in a multiplatform project.

expect and actual declarations have the same name and be in the same package (having the same fully qualified name).An expected declaration is marked with the expect keyword and an actual declaration is marked with the actual keyword.When using expected and actual definitions, some basic rules need to be followed: This works for functions, classes, interfaces, enumerations, properties and annotations. This mechanism requires an expected definition to be declared in the common source set and a corresponding actual definition to be declared in the platform source sets. The mechanism of expected and actual definitions can be used in a multiplatform application that needs to access platform-specific functionality. All of these have very different representations across the different platforms and it is not possible to share them. Almost every application will need to deal with some platform-specific stuff such as I/O, files, dates, encryption and hashing, UUIDs. Sharing code in the common module is great but, sadly, not possible all the time. This is Part 2 of a series, so make sure to check out Part 1: Sharing Application logic with Kotlin Multiplatform.

This blog post looks at interfacing with platform-specific code using Kotlin Multiplatform.
