Documentation ¶
Overview ¶
Copyright 2016 The Serviced Authors. 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
http://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 ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PackageLogger ¶
PackageLogger returns a logger for a given package.
Types ¶
type ContextHook ¶
type ContextHook struct{}
ContextHook is a hook to provide context in log messages
func (ContextHook) Fire ¶
func (hook ContextHook) Fire(entry *logrus.Entry) error
Fire satisfies the logrus.Hook interface. This impl figures out the file and line number of the caller and adds them to the data.
func (ContextHook) Levels ¶
func (hook ContextHook) Levels() []logrus.Level
Levels satisfies the logrus.Hook interface. This hook applies to all levels.
type LogControl ¶
type LogControl interface { SetLevel(level logrus.Level) ApplyConfigFromFile(file string) error WatchConfigFile(file string) // Legacy glog interface SetVerbosity(value int) GetVerbosity() int SetToStderr(value bool) SetAlsoToStderr(value bool) SetStderrThreshold(value string) error SetVModule(value string) error SetTraceLocation(value string) error }
func NewLogControl ¶
func NewLogControl() LogControl