Commit Graph

6 Commits

Author SHA1 Message Date
Phil Porada ce1b77241e
Conditionally call Sprintf in log package (#6721)
The Debug, Info, Warn, and Err log levels are now helper functions that
call their respective <LogLevel>f function. Each <LogLevel>f function
takes a variadic amount of format specifiers to pass to auditAtLevel or
logAtLevel which in turn will perform a nil check on the variadic input
parameter 'a' and call/ignore an Sprintf accordingly.

Fixes #6131
2023-03-08 16:06:07 -05:00
Jacob Hoffman-Andrews ad840b4410
reloader: log reload events directly (#6398)
Previously, the reloader relied on user code to log errors and changes.
But this led to gaps (for instance the RA not logging reloads of the rate
limit file). Instead, make the reloader responsible for this.

This allowed removing the error callback, at the minor cost of removing
the status gauge for the ECDSA allowlist.
2022-09-23 14:41:54 -07:00
Andrew Gabbitas a718a9349d
Add waiting mock log writer (#5359)
Add a mock log buffer that is able to wait for a regex match in the
log buffer or timeout and error.

Fixes #5310
2021-04-01 10:53:21 -07:00
Josh Soref 8adf9d41cf Spelling (#2500)
Various spelling fixes.
2017-01-16 10:44:52 -05:00
Roland Bracewell Shoemaker 54573b36ba Remove all stray copyright headers and appends the initial line to LICENSE.txt (#1853) 2016-05-31 12:32:04 -07:00
Jacob Hoffman-Andrews ecc04e8e61 Refactor log package (#1717)
- Remove error signatures from log methods. This means fewer places where errcheck will show ignored errors.
- Pull in latest cfssl to be compatible with errorless log messages.
- Reduce the number of message priorities we support to just those we actually use.
- AuditNotice -> AuditInfo
- Remove InfoObject (only one use, switched to Info)
- Remove EmergencyExit and related functions in favor of panic
- Remove SyslogWriter / AuditLogger separate types in favor of a single interface, Logger, that has all the logging methods on it.
- Merge mock log into logger. This allows us to unexport the internals but still override them in the mock.
- Shorten names to be compatible with Go style: New, Set, Get, Logger, NewMock, etc.
- Use a shorter log format for stdout logs.
- Remove "... Starting" log messages. We have better information in the "Versions" message logged at startup.

Motivation: The AuditLogger / SyslogWriter distinction was confusing and exposed internals only necessary for tests. Some components accepted one type and some accepted the other. This made it hard to consistently use mock loggers in tests. Also, the unnecessarily fat interface for AuditLogger made it hard to meaningfully mock out.
2016-04-08 16:12:20 -07:00