Documentation ¶
Overview ¶
Copyright 2016 The Web BSD Hunt 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.
//////////////////////////////////////////////////////////////////////////////
TODO: High-level file comment. lightweight logging library with the ability to independently configure the output function and to dynamically enable and disable and filter up to 64 log levels.
Index ¶
- type Logger
- func (logger *Logger) Disable(name string) error
- func (logger *Logger) Enable(name string) error
- func (logger *Logger) Fatalf(format string, v ...interface{})
- func (logger *Logger) Level(name string) (uint64, error)
- func (logger *Logger) Log(level uint64, format string, v ...interface{})
- func (logger *Logger) MustLevel(name string) uint64
- func (logger *Logger) Printf(format string, v ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct { Levels map[string]uint64 Enabled uint64 Output func(format string, v ...interface{}) }
func MustNewLogger ¶
like NewLogger but panic instead of returning error
func MustNewLoggerFromString ¶
splits the enabled string at "," characters, and tries to enable each level so found, calls panic instead of returning error if any enabled levels have not been configured.
func (*Logger) Level ¶
Convert a name into a log level Can be used to cache level bits for later use