Module stderr::log [] [src]

log module

dbxx!()/infoxx!()/warnxx!()/errorxx!()/fatalxx print message while environment variable 'LOG' or command line arguments conntains -log or --log

Synntax: LogLvl?/module_path,*

Logger will init by above value, stderr will print the message at stderr() if them's location and level pass Logger::filter()(Use a stderr crate.)

Example(if crate'name is 'app', a dependency's name is map):

Bash

   env LOG=/                # -> `all/app`
   env LOG="info/app"       # -> `info/app`
   env LOG="info/app,map"   # -> `info/app,map`

env LOG=info/* # -> "info/*" ,# is all crate

Fish

 set -x LOG /                # -> `all/app`
 set -x LOG "info/app"       # -> `info/app`
 set -x LOG "info/app,map"   # -> `info/app,map`
 set -e LOG                  # remove environment variable

Cli_Options_Argument

   ./app -log   /               # -> `all/app`
   ./app -log   info/app        # -> `info/app`
   ./app -log   info/app,map    # -> `info/app,map`

You must use logger_init!() before use them on the current process.

Structs

LogFmter

Log Formater

LogLoc

Log Location

LogMsg

Log Message

Logger

Logger

Enums

LogLvl

Log Level

Statics

CLI_OPTION_KEYS

["-log", "--log"]

ENV_VAR_KEY

"LOG"

Traits

IntoLogFmter

Format LogMsg by Fn(&LogMsg) -> String + 'static + Send

Functions

fmter

[Debug!]#main:6:4 ..

fmter_with_time

[2017-05-30 13:10:00 Debug!]#main:12:8 ..