Batamanta.Logger (batamanta v1.5.0)

Copy Markdown View Source

Streaming logger that can output to banner or standard Mix shell.

When a banner context is provided, messages appear on the right side of the banner image. Otherwise, messages go to standard output.

Summary

Functions

Creates a logger function that can be passed around.

Logs an error message.

Logs a message through the banner or standard shell.

Types

banner_ctx()

@type banner_ctx() :: map() | nil

Functions

create_logger(ctx)

Creates a logger function that can be passed around.

log = Batamanta.Logger.create_logger(ctx)
log.("Message here")

error(ctx, message)

Logs an error message.

info(ctx, message)

Logs a message through the banner or standard shell.

ctx = Batamanta.Banner.show_with_context(["initial"])
Batamanta.Logger.info(ctx, "Processing...")

Batamanta.Logger.info(nil, "Processing...")