createChannel

Creates a new log channel with the specified name and schema, and adds it to the log.

Return

A new WriterChannel bound to this writer

Parameters

T

The type of objects that will be written to this channel

name

The unique name for the channel

schema

The schema defining how objects of type T will be serialized

Throws

if a channel with the same name already exists


Creates a new log channel with the specified name and automatically inferred schema.

The schema is automatically derived from the provided Java class using reflection. This is convenient for simple data classes but may not work for complex types.

Return

A new WriterChannel bound to this writer

Parameters

T

The type of objects that will be written to this channel

name

The unique name for the channel

cls

The Java class to derive the schema from

Throws

if a channel with the same name already exists


fun <T : Any> createChannel(name: String, cls: KClass<T>): <Error class: unknown class>

Creates a new log channel with the specified name and automatically inferred schema.

The schema is automatically derived from the provided Kotlin class using reflection. This is convenient for simple data classes but may not work for complex types.

Return

A new WriterChannel bound to this writer

Parameters

T

The type of objects that will be written to this channel

name

The unique name for the channel

cls

The Kotlin class to derive the schema from

Throws

if a channel with the same name already exists