diff --git a/README.md b/README.md index 6874160..a4c43b6 100644 --- a/README.md +++ b/README.md @@ -258,13 +258,36 @@ Of course you may use any emoji you wish but note that they may not render as ex ## Configuration -**TODO!** +### Setting Custom Output Stream -- VERBOSE -- SILENT -- Set* methods +You can provide you own `io.Writer` via `SetMessageTarget` method. This can be useful for testing and for scenarios where you wish to disable the "subprocess friendliness" of writing to `tty` directly. +```go +message.SetMessageTarget(os.Stderr) +``` + +### Enabling Verbose Mode + +1. Set `VERBOSE=true` environment variable +2. Set `_VERBOSE=true` environment variable +3. Use `message.SetVerboseMode(true)` method
(setting this to `false` has no effect if above environment variables present) + +### Enabling Silent Mode + +1. Use `message.SetSiletMode(true)` method
(setting this to `true` has no effect if _Verbose Mode_ is enabled) + +### Disabling Color + +1. Set `NO_COLOR=true` environment variable +2. Set `_NO_COLOR=true` environment variable +3. Use `message.SetColorMode(false)` method
(setting this to `true` has no effect if above environment variables present) + + +### Disabling Emoji + +1. Disabling Color will disable Emoji as well +2. Set `NO_EMOJI=true` environment variable +3. Set `_NO_EMOJI=true` environment variable +4. Use `message.SetEmojiMode(false)` method
(setting this to `true` has no effect if above environment variables present) -## Design -1. Environment Variables should win diff --git a/setup.go b/setup.go index 3485598..b7f1771 100644 --- a/setup.go +++ b/setup.go @@ -186,7 +186,3 @@ func formatPrefixedEnvVar(prefix string, envVar string) string { changecase.Constant(strings.TrimSpace(envVar)), ) } - -// TODO allow disable tty - -// TODO handle ENV VARs when Set* Methods used