logger

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: Apache-2.0, BSD-2-Clause-Views, BSD-3-Clause, + 4 more Imports: 8 Imported by: 0

README

logger

Why We Need Different Setups for Production and Non-Production Builds on Windows

When running wails build, Wails builds the app with the -H windowsgui linker flag. This sets the \SUBSYSTEM PE header variable to WINDOWS. Processes configured with this value have their standard I/O handles closed by default. However, during wails dev, the I/O handlers function as expected.

In development mode, we use io.MultiWriter to write logs to both os.Stdout and a file logger. The io.MultiWriter function synchronously writes to each of its children, meaning that if any single child hangs, the entire operation hangs. This becomes problematic in production because the closed os.Stdout handle will cause each log operation to hang indefinitely.

To avoid this issue, we log exclusively to the filesystem in production.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenLogsDirectory

func OpenLogsDirectory() error

func Redacted

func Redacted(input any) string

Redacted redacts sensitive data in production logs. In non-production environments, it returns the string representation of the input value. In a production environment, it always returns the constant "[REDACTED]" to ensure sensitive information is not exposed.

func SetupLogger

func SetupLogger() error

Types

This section is empty.

Jump to

Keyboard shortcuts

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