Files
katenary/doc/docs/packages/internal/logger.md
2026-05-03 21:21:38 +02:00

2.9 KiB

logger

import "katenary.io/internal/logger"

Package logger provides simple logging functions with icons and colors.

Constants

const (
    ColorGreen   = "\033[38;5;34m"
    ColorRed     = "\033[38;5;196m"
    ColorOrange  = "\033[38;5;214m"
    ColorWarning = "\033[38;5;214m"
)

func Failure

func Failure(msg ...any)

Failure prints a failure message.

func Failuref

func Failuref(format string, msg ...any)

Failuref prints a formatted failure message.

func Fatal

func Fatal(msg ...any)

Fatal prints a fatal error message and exits with code 1.

func Fatalf

func Fatalf(format string, msg ...any)

Fatalf prints a fatal error message with formatting and exits with code 1.

func FlushWarnings

func FlushWarnings()

FlushWarnings prints all collected warnings at the end of the conversion.

func Info

func Info(msg ...any)

Info prints an informational message.

func Infof

func Infof(format string, msg ...any)

Infof prints a formatted informational message.

func Log

func Log(icon Icon, msg ...any)

Log prints a message with a custom icon.

func Logf

func Logf(icon Icon, format string, msg ...any)

Logf prints a formatted message with a custom icon.

func Print

func Print(msg ...any)

Print prints a message without icon.

func Printf

func Printf(format string, msg ...any)

Printf prints a formatted message without icon.

func Success

func Success(msg ...any)

Success prints a success message.

func Successf

func Successf(format string, msg ...any)

Successf prints a formatted success message.

func Warn

func Warn(msg ...any)

Warn prints a warning message.

func Warnf

func Warnf(format string, msg ...any)

Warnf prints a formatted warning message.

type Icon

Icon is a unicode icon

type Icon string

Icons used in katenary.

const (
    IconSuccess    Icon = "✅"
    IconFailure    Icon = "❌"
    IconWarning    Icon = "❕"
    IconNote       Icon = "📝"
    IconWorld      Icon = "🌐"
    IconPlug       Icon = "🔌"
    IconPackage    Icon = "📦"
    IconCabinet    Icon = "🗄️"
    IconInfo       Icon = "🔵"
    IconSecret     Icon = "🔒"
    IconConfig     Icon = "🔧"
    IconDependency Icon = "🔗"
)

Generated by gomarkdoc