component

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package component provides log lifecycle integration for bootstrap.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Component

func Component() bootstrap.IComponent

Component initialises the logging system from env configuration. It reads log.level, log.file.path and related keys during Init().

No configuration is accepted at construction time to prevent accidental calls to env.Env() before the env component has been initialised.

Example

ExampleComponent shows how log.Component() is used as the second argument to bootstrap.New(). It reads log configuration from env during Init() and flushes the async write buffer during Close() — which is called absolutely last by the framework so no cleanup log messages are lost.

package main

import (
	"fmt"

	logComp "github.com/phcp-tech/common-library-golang/log/component"
)

func main() {
	c := logComp.Component()
	fmt.Println(c != nil)
	fmt.Println(c.Name())
}
Output:
true
log

Types

This section is empty.

Jump to

Keyboard shortcuts

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