Documentation
¶
Overview ¶
Package slog provides alternative syslog client API. An internal syslog writer used to send messages to a syslog service with options to tune it.
Copyright 2019 Google LLC ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func Alert(v ...interface{})
- func Alertf(format string, v ...interface{})
- func Crit(v ...interface{})
- func Critf(format string, v ...interface{})
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Emerg(v ...interface{})
- func Emergf(format string, v ...interface{})
- func Err(v ...interface{})
- func Errf(format string, v ...interface{})
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func Init(opts ...Option) error
- func Notice(v ...interface{})
- func Noticef(format string, v ...interface{})
- func ParseFacility(facility string) (syslog.Priority, error)
- func Warning(v ...interface{})
- func Warningf(format string, v ...interface{})
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Alertf ¶
func Alertf(format string, v ...interface{})
Alertf sends a formatted syslog message with severity LOG_ALERT.
func Critf ¶
func Critf(format string, v ...interface{})
Critf sends a formatted syslog message with severity LOG_CRIT.
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf sends a formatted syslog message with severity LOG_DEBUG.
func Emergf ¶
func Emergf(format string, v ...interface{})
Emergf sends a formatted syslog message with severity LOG_EMERG.
func Errf ¶
func Errf(format string, v ...interface{})
Errf sends a formatted syslog message with severity LOG_ERR.
func Infof ¶
func Infof(format string, v ...interface{})
Infof sends a formatted syslog message with severity LOG_INFO.
func Init ¶
Init initializes or re-initializes internal syslog writer. It is expected to be safe to call this function from concurrent goroutines.
func Noticef ¶
func Noticef(format string, v ...interface{})
Noticef sends a formatted syslog message with severity LOG_NOTICE.
func ParseFacility ¶
ParseFacility converts string representation of a syslog facility into syslog.Priority value. The standard facilities as described by FreeBSD `man syslog' as of 12.0-RELEASE are recognised (LOG_DAEMON, LOG_USER, etc). Parsing is case insensitive and LOG_ prefix is optional and can be omitted.
Types ¶
type Option ¶
type Option func(p *params)
func WithDial ¶
WithTag is an option for Init to specify parameter syslog service connection. Both values will be passed to syslog.Dia, see corresponding documentation for more details. As of the time this text being written, an empty value of network parameter requests a connection over a UNIX socket to a local syslog service (raddr is ignored in this case). Alternatively network can be a string accepted by net.Dial.
func WithFacility ¶
WithFacility is an option for Init which adjusts facility in outgoing syslog messages.