diff options
| author | Will Hawkins <[email protected]> | 2022-05-05 01:59:46 -0400 |
|---|---|---|
| committer | Will Hawkins <[email protected]> | 2022-05-05 01:59:46 -0400 |
| commit | 2a9feb82b55481308c0f6aa9d813e9021b0333ef (patch) | |
| tree | ebe116516ce93446508100ccac64178a20ac3a6f /debug | |
| parent | 10ddc4e9c56beeb5718cd878313ddf88695a1948 (diff) | |
Upgraded RPM Calculation Support (Take 1)
This patch begins the work on updated RPM calculations using
the httptrace infrastructure. Because we are still not able
to break out the TLS handshake time due to upstream bugs, there
are some workarounds in place. However, the numbers appear much
more sane.
Diffstat (limited to 'debug')
| -rw-r--r-- | debug/debug.go | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/debug/debug.go b/debug/debug.go new file mode 100644 index 0000000..2a3df4a --- /dev/null +++ b/debug/debug.go @@ -0,0 +1,35 @@ +package debug + +type DebugLevel int8 + +const ( + NoDebug DebugLevel = iota + Debug + Warn + Error +) + +type DebugWithPrefix struct { + Level DebugLevel + Prefix string +} + +func NewDebugWithPrefix(level DebugLevel, prefix string) *DebugWithPrefix { + return &DebugWithPrefix{Level: level, Prefix: prefix} +} + +func (d *DebugWithPrefix) String() string { + return d.Prefix +} + +func IsDebug(level DebugLevel) bool { + return level <= Debug +} + +func IsWarn(level DebugLevel) bool { + return level <= Warn +} + +func IsError(level DebugLevel) bool { + return level <= Error +} |
