3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-22 03:49:27 +01:00

logger: Fix comments

This commit is contained in:
Daniel Oaks 2017-10-06 12:44:11 +10:00
parent 68b1dc9e72
commit 9f7e395c96

View File

@ -60,7 +60,7 @@ type Manager struct {
loggingRawIO bool loggingRawIO bool
} }
// Config represents the configuration of a single logger. // LoggingConfig represents the configuration of a single logger.
type LoggingConfig struct { type LoggingConfig struct {
Method string Method string
MethodStdout bool MethodStdout bool
@ -85,6 +85,7 @@ func NewManager(config []LoggingConfig) (*Manager, error) {
return &logger, nil return &logger, nil
} }
// ApplyConfig applies the given config to this logger (rehashes the config, in other words).
func (logger *Manager) ApplyConfig(config []LoggingConfig) error { func (logger *Manager) ApplyConfig(config []LoggingConfig) error {
logger.configMutex.Lock() logger.configMutex.Lock()
defer logger.configMutex.Unlock() defer logger.configMutex.Unlock()
@ -140,6 +141,7 @@ func (logger *Manager) ApplyConfig(config []LoggingConfig) error {
return lastErr return lastErr
} }
// IsLoggingRawIO returns true if raw user input and output is being logged.
func (logger *Manager) IsLoggingRawIO() bool { func (logger *Manager) IsLoggingRawIO() bool {
logger.configMutex.RLock() logger.configMutex.RLock()
defer logger.configMutex.RUnlock() defer logger.configMutex.RUnlock()