# README
==================== Standard Logger Ex
.. image:: https://pkg.go.dev/badge/github.com/rusq/dlog.svg :target: https://pkg.go.dev/github.com/rusq/dlog
What is this?
This is a simple wrapper around the standard go runtime logger with only one goal:
- ADD DEBUG OUTPUT FUNCTIONS.
Functions that are available for the caller:
- All those in "log" AND
- Debug
- Debugf
- Debugln
On the package base level these functions will print output only if the
DEBUG
environment variable is present and have some non-empty value.
Otherwise, one can construct a new logger::
func New(out io.Writer, prefix string, flag int, debug bool) *Logger
for the flags, one could use the values from the standard logger.
Usage
Import it in your project replacing "log" import entry:
.. code:: go
import ( log "github.com/rusq/dlog" )
Use:
.. code:: go
log.Debug("hello debug!")
Check if debug is enabled:
.. code:: go
log.IsDebug()
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
Fatal is equivalent to Print() followed by a call to os.Exit(1).
Fatalf is equivalent to Printf() followed by a call to os.Exit(1).
Fatalln is equivalent to Println() followed by a call to os.Exit(1).
Flags returns the output flags for the standard logger.
FromContext returns the Logger value stored in ctx, if any.
IsDebug returns true if the debugging output is enabled.
No description provided by the author
NewContext returns a new Context that has logger attached.
Output writes the output for a logging event.
Panic is equivalent to Print() followed by a call to panic().
Panicf is equivalent to Printf() followed by a call to panic().
Panicln is equivalent to Println() followed by a call to panic().
Prefix returns the output prefix for the standard logger.
Print calls Output to print to the standard logger.
Printf calls Output to print to the standard logger.
Println calls Output to print to the standard logger.
SetDebug sets/resets the debugging output.
SetFlags sets the output flags for the standard logger.
SetOutput sets the output destination for the standard logger.
SetPrefix sets the output prefix for the standard logger.
Writer returns the output destination for the standard logger.