Documentation ¶
Overview ¶
Package logging maintains interface for two core supported types of logging that occur within Jacamar. First is communication with the job log that is handled via a Messenger. Secondly is the optionally configured system logging that is provided via the Logger. Any system logging is targeted at a privileged user with Jacamar-Auth.
Index ¶
Constants ¶
const ( ANSIBoldRed = "\033[31;1m" // Error ANSIBoldGreen = "\033[32;1m" // Notify ANSIYellow = "\033[0;33m" // Warning ANSIReset = "\033[0;m" )
Using the same codes as upstream GitLab.
Variables ¶
This section is empty.
Functions ¶
func EstablishLogger ¶
func EstablishLogger( stage string, opts configure.Options, req envparser.RequiredEnv, ) (*logrus.Entry, error)
EstablishLogger uses a combination of known/trusted environmental context coupled with administrator configuration to establish rules for Logrus.
Types ¶
type Messenger ¶
type Messenger interface { // Stdout prints a formatted message (no color) to stdout. Stdout(string, ...interface{}) // Stderr prints a formatted message (no color) to stderr. Stderr(string, ...interface{}) // Warn prints a formatted message (yellow text) to stdout. Warn(string, ...interface{}) // Notify prints a formatted message (bold green text) to stdout. Notify(string, ...interface{}) // Error prints a formatted message (bold red text) to stderr. Error(string, ...interface{}) }
Messenger is the interface to conveying key user information to the current CI job log via stdout/stderr to the GitLab runner. Messages of sufficient lever can be wrapped in appropriate ANSI characters to increase visibility to the user.
func NewMessenger ¶
func NewMessenger() Messenger
NewMessenger generates a functional Messenger interface that should be used to convey details/messages to the job log.