utils

package
v1.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizeForLog

func SanitizeForLog(s string, maxLength ...int) string

SanitizeForLog sanitizes a string for safe logging by removing or escaping control characters that could cause log injection attacks. The optional maxLength parameter controls truncation (default: 100). Pass 0 or negative to disable truncation. TODO: Consider migrating to structured logging which handles sanitization automatically through field encoding.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL