Skip to content

Commit

Permalink
Update doc and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
onevcat committed Jan 8, 2025
1 parent 90ab640 commit 4686b07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,9 @@ This is useful for sharing the same code for logging to console and to a log fil
You can manually change this behavior by either:

- Set the `Rainbow.outputTarget` yourself.
- Pass a `"NO_COLOR"` environment value when executing your app.
- Or set the `Rainbow.enabled` to `false`.
- Pass `NO_COLOR=1` as environment value when executing your app to disable color.
- Pass `FORCE_COLOR=1` to enable color even if the output is not a tty. ([`FORCE_COLOR`](https://force-color.org/) has a higher priority than `NO_COLOR`)
- Or set the `Rainbow.enabled` in your code explicitly.


### Verbose Way
Expand Down
3 changes: 2 additions & 1 deletion Sources/Rainbow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ public enum Rainbow {
}

/// Enable `Rainbow` to colorize string or not. Default is `true`, unless the `NO_COLOR` environment variable is
/// set and `FORCE_COLOR` not set. (`FORCE_COLOR` has higher priority than `NO_COLOR` if set)
/// set and `FORCE_COLOR` not set to a valid value ("0" or empty value is treated as "unset". `FORCE_COLOR` has
/// higher priority than `NO_COLOR` if set).
public static var enabled = environmentAvailable

public static func extractEntry(for string: String) -> Entry {
Expand Down

0 comments on commit 4686b07

Please sign in to comment.