Documentation ¶
Index ¶
Constants ¶
const Deployment = Production
Deployment specifies a production build.
const LoggingType = LogTypeDefault
LoggingType is a log type that writes to both stdout and the log rotator, if present.
Variables ¶
var ( // PreRelease is defined as a variable so it can be overridden during the // build process with: // '-ldflags "-X github.com/decred/dcrlnd/build.PreRelease=foo"' // if needed. It MUST only contain characters from semanticAlphabet per // the semantic versioning spec. PreRelease = "pre" // BuildMetadata is defined as a variable so it can be overridden during the // build process with: // '-ldflags "-X github.com/decred/dcrlnd/build.BuildMetadata=foo"' // if needed. It MUST only contain characters from semanticBuildAlphabet // per the semantic versioning spec. BuildMetadata = "dev" // Commit is defined as a variable so it can be overriden during the // build process with: // '-ldflags "-X github.com/decred/dcrlnd/build.Commit=foo"' // if needed. It is NOT included in the version string returned by this // module and MUST only contain characters from semanticBuildAlphabet. Commit = "" )
var LogLevel = "info"
LogLevel specifies a default log level of info.
Functions ¶
func NewSubLogger ¶
NewSubLogger constructs a new subsystem log from the current LogWriter implementation. This is primarily intended for use with stdlog, as the actual writer is shared amongst all instantiations.
func SourceCommit ¶ added in v0.2.0
func SourceCommit() string
SourceCommit returns the normalized version of the Commit variable according to the rules of semantic versioning guidelines.
func Version ¶
func Version() string
Version returns the application version as a properly formed string per the semantic versioning 2.0.0 spec (https://semver.org/).
Types ¶
type DeploymentType ¶
type DeploymentType byte
DeploymentType is an enum specifying the deployment to compile.
const ( // Development is a deployment that includes extra testing hooks and // logging configurations. Development DeploymentType = iota // Production is a deployment that strips out testing logic and uses // Default logging. Production )
func (DeploymentType) String ¶
func (b DeploymentType) String() string
String returns a human readable name for a build type.
type LogType ¶
type LogType byte
LogType is an indicating the type of logging specified by the build flag.
type LogWriter ¶
type LogWriter struct { // RotatorPipe is the write-end pipe for writing to the log rotator. It // is written to by the Write method of the LogWriter type. This only // needs to be set if neither the stdlog or nolog builds are set. RotatorPipe *io.PipeWriter }
LogWriter is a stub type whose behavior can be changed using the build flags "stdlog" and "nolog". The default behavior is to write to both stdout and the RotatorPipe. Passing "stdlog" will cause it only to write to stdout, and "nolog" implements Write as a no-op.