component

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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