writers

package
v0.24.3 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONSOLE TYPE = 1 << iota // Log to console.
	FILE                     // Log to file.
	AWS                      // Log to AWS (placeholder, not implemented).

	SUCCESS = true  // Indicates success log.
	FAILURE = false // Indicates failure or error log.

	DEFAULT = CONSOLE | FILE // Default log destinations.
)

Constants representing different logging destinations and log types.

Variables

View Source
var (
	FILE_STDERR = path.Join(config.PATH_LOGS, config.BUILD_APP_NAME+".err") // File path for standard error logs.
	FILE_STDOUT = path.Join(config.PATH_LOGS, config.BUILD_APP_NAME+".out") // File path for standard output logs.

	CONSOLE_STDERR = os.Stderr // Standard error console output.
	CONSOLE_STDOUT = os.Stdout // Standard output console output.
)

File paths for standard error and standard output logs.

Functions

func Make

func Make(t TYPE, sof SOF) io.Writer

Make creates an io.Writer based on the specified TYPE and SOF. It can create a multi-writer that writes to console and/or file based on the provided flags.

Parameters: - t: TYPE The type of writer(s) to create. - sof: SOF Indicates whether the writer is for success (true) or failure (false) logs.

Returns: - io.Writer: A writer that logs to the specified destinations.

Types

type SOF

type SOF bool

SOF (Success Or Failure) is a boolean type used to indicate the nature of the log (success or failure).

type TYPE

type TYPE uint8

TYPE is a custom type representing different writer types.

Jump to

Keyboard shortcuts

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