You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Align template variables with Docker nomenclature
The .ContainerName was in fact the service name when using compose. It's
now the actual container name and the service name is available as
.ServiceName. For convenience .ServiceName is set to the container name
when using plain docker.
When support for Swarm is added the naming becomes inconsistent as the
name for the same concept changes between Swarm and non-Swarm. A compose
project is the equivalent of a Swarm namespace/stack. So the
.ComposeProject is changed to .Namespace as it's a quite neutral name
for both setups. The .ComposeColor is changed accordingly.
Similarly, in compose the container instance is called container number
whereas in Swarm it's called a slot. The new variable to be used for
both is .ContainerNumber.
Copy file name to clipboardExpand all lines: README.md
+20-17Lines changed: 20 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -39,16 +39,16 @@ The `container query` is a regular expression of the container name; you could p
39
39
`--color` | `auto` | Force set color output. 'auto': colorize if tty attached, 'always': always colorize, 'never': never colorize.
40
40
`--completion` | | Output tailfin command-line completion code for the specified shell. Can be 'bash', 'zsh' or 'fish'.
41
41
`--compose` | `[]` | Compose project name to match (regular expression)
42
-
`--compose-colors` | | Specifies the colors used to highlight container names. Provide colors as a comma-separated list using SGR (Select Graphic Rendition) sequences, e.g., "91,92,93,94,95,96".
43
42
`--config` | `~/.config/tailfin/config.yaml` | Path to the tailfin config file
44
-
`--container-colors` | | Specifies the colors used to highlight compose project names. Use the same format as --container-colors. Defaults to the values of --container-colors if omitted, and must match its length.
43
+
`--container-colors` | | Specifies the colors used to highlight container names. Provide colors as a comma-separated list using SGR (Select Graphic Rendition) sequences, e.g., "91,92,93,94,95,96".
`--label`, `-l` | `[]` | Label query to filter on. One key or `key=value` per flag instance.
51
50
`--max-log-requests` | `-1` | Maximum number of concurrent logs to request. Defaults to 50, but 5 when specifying --no-follow
51
+
`--namespace-colors` | | Specifies the colors used to highlight namespace (compose project). Use the same format as --container-colors. Defaults to the values of --container-colors if omitted, and must match its length.
52
52
`--no-follow` | `false` | Exit when all logs have been shown.
53
53
`--only-log-lines` | `false` | Print only log lines
| `json` | `object` | Marshal the object and output it as a json text |
110
-
| `color` | `color.Color, string` | Wrap the text in color (.ContainerColor and .ComposeColor provided) |
113
+
| `color` | `color.Color, string` | Wrap the text in color (.ContainerColor and .NamespaceColor provided) |
111
114
| `parseJSON` | `string` | Parse string as JSON |
112
115
| `tryParseJSON` | `string` | Attempt to parse string as JSON, return nil on failure |
113
116
| `extractJSONParts` | `string, ...string` | Parse string as JSON and concatenate the given keys. |
@@ -145,21 +148,21 @@ You can configure highlight colors for compose projects and containers in [the c
145
148
146
149
```yaml
147
150
# Green, Yellow, Blue, Magenta, Cyan, White
148
-
compose-colors: "32,33,34,35,36,37"
151
+
namespace-colors: "32,33,34,35,36,37"
149
152
150
153
# Colors with underline (4)
151
-
# If empty, the compose colors will be used as container colors
154
+
# If empty, the namespace will be used as container colors
152
155
container-colors: "32;4,33;4,34;4,35;4,36;4,37;4"
153
156
```
154
157
155
158
This format enables the use of various attributes, such as underline, background colors, 8-bit colors, and 24-bit colors, if your terminal supports them.
156
159
157
-
The equivalent flags `--compose-colors` and `--container-colors` are also available. The following command applies [24-bit colors](https://en.wikipedia.org/wiki/ANSI_escape_code#24-bit) using the `--compose-colors` flag.
160
+
The equivalent flags `--namespace-colors` and `--container-colors` are also available. The following command applies [24-bit colors](https://en.wikipedia.org/wiki/ANSI_escape_code#24-bit) using the `--namespace-colors` flag.
@@ -356,10 +355,9 @@ func (o *options) AddFlags(fs *pflag.FlagSet) {
356
355
fs.IntVar(&o.verbosity, "verbosity", o.verbosity, "Number of the log level verbosity")
357
356
fs.BoolVarP(&o.version, "version", "v", o.version, "Print the version and exit.")
358
357
fs.BoolVar(&o.stdin, "stdin", o.stdin, "Parse logs from stdin. All Docker related flags are ignored when it is set.")
359
-
fs.StringSliceVar(&o.containerColors, "compose-colors", o.containerColors, "Specifies the colors used to highlight container names. Provide colors as a comma-separated list using SGR (Select Graphic Rendition) sequences, e.g., \"91,92,93,94,95,96\".")
360
-
fs.StringSliceVar(&o.composeColors, "container-colors", o.composeColors, "Specifies the colors used to highlight compose project names. Use the same format as --container-colors. Defaults to the values of --container-colors if omitted, and must match its length.")
358
+
fs.StringSliceVar(&o.containerColors, "container-colors", o.containerColors, "Specifies the colors used to highlight container names. Provide colors as a comma-separated list using SGR (Select Graphic Rendition) sequences, e.g., \"91,92,93,94,95,96\".")
359
+
fs.StringSliceVar(&o.namespaceColor, "namespace-colors", o.namespaceColor, "Specifies the colors used to highlight namespace (compose project). Use the same format as --container-colors. Defaults to the values of --container-colors if omitted, and must match its length.")
361
360
// TODO: --context for docker context? Seems to be a `docker` thing, not a dockerd thing.
362
-
// TODO: --ignore-compose to make it unaware of compose (e.g. use full container name)
0 commit comments