### Used in pkg/util/log/logconfig/config_test.go

# Check how the empty config pretty-prints itself.
yaml
----
{}

# Verify that it's possible to only pass a subset
# of the fields in the YAML input.
yaml
capture-stray-errors:
  enable: true
sinks:
  file-groups:
    auth:
      dir: /hello/world
----
sinks:
  file-groups:
    auth:
      dir: /hello/world
capture-stray-errors:
  enable: true

# Verify that a channel can be selected.
yaml
sinks:
   stderr:
     channels: DEV
----
sinks:
  stderr:
    channels: [DEV]


# Verify that more than one channel can be selected.
yaml
sinks:
  stderr:
   channels: dev,SESSIONS
----
sinks:
  stderr:
    channels: [DEV, SESSIONS]

# Ditto using a native YAML array.
yaml
sinks:
  stderr:
   channels: [dev,SESSIONS]
----
sinks:
  stderr:
    channels: [DEV, SESSIONS]

# Ditto using an array included in a string.
yaml
sinks:
  stderr:
   channels: '[dev,SESSIONS]'
----
sinks:
  stderr:
    channels: [DEV, SESSIONS]



# Verify that all channels can be selected.
yaml
sinks:
  stderr:
     channels: all
----
sinks:
  stderr:
    channels: all

# Ditto using a native YAML array.
yaml
sinks:
  stderr:
     channels: [all]
----
sinks:
  stderr:
    channels: all

# Ditto included in a string.
yaml
sinks:
  stderr:
     channels: '[all]'
----
sinks:
  stderr:
    channels: all

# Verify that the special keyword "all" is not allowed
# in a YAML array unless it's on its own.
yaml
sinks:
  stderr:
     channels: [all,dev]
----
ERROR: cannot use ALL if there are other channel names present in the list


# Verify that the inverse of a channel list can be selected.
yaml
sinks: { stderr: { channels: 'all except DEV ,sessions' } }
----
sinks:
  stderr:
    channels: [OPS, HEALTH, STORAGE, SQL_SCHEMA, USER_ADMIN, PRIVILEGES, SENSITIVE_ACCESS, SQL_EXEC, SQL_PERF, SQL_INTERNAL_PERF, TELEMETRY, KV_DISTRIBUTION]

yaml
sinks: { stderr: { channels: 'all except [DEV, sessions]' } }
----
sinks:
  stderr:
    channels: [OPS, HEALTH, STORAGE, SQL_SCHEMA, USER_ADMIN, PRIVILEGES, SENSITIVE_ACCESS, SQL_EXEC, SQL_PERF, SQL_INTERNAL_PERF, TELEMETRY, KV_DISTRIBUTION]

# Verify that channels can be filtered separately.
yaml
sinks: {stderr: {channels: {INFO: 'DEV,HEALTH', WARNING: TELEMETRY}}}
----
sinks:
  stderr:
    channels: {INFO: [DEV, HEALTH], WARNING: [TELEMETRY]}

# Try populating all the fields.
yaml
file-defaults:
     dir: /default/dir
     filter: ERROR
     format: foo
     format-options: {bar: baz}
     redact: true
     redactable: false
     max-file-size: 10MB
     max-group-size: 100MB

sinks:
  file-groups:
    auth:
       dir: /hello/world
       max-group-size: 1GB
    debug:
       dir: universe
       max-file-size: 1MB
    perf:
       filter: INFO
       redact: true

  fluent-servers:
    default:
      address: 127.0.0.1:5170
    other:
      channels: {WARNING: HEALTH}
      net: udp
      address: 127.0.0.1:5111

  stderr:
    filter: WARNING
    redact: false
    redactable: true

----
file-defaults:
  dir: /default/dir
  max-file-size: 9.5MiB
  max-group-size: 95MiB
  filter: ERROR
  format: foo
  format-options:
    bar: baz
  redact: true
  redactable: false
sinks:
  file-groups:
    auth:
      dir: /hello/world
      max-group-size: 954MiB
    debug:
      dir: universe
      max-file-size: 977KiB
    perf:
      filter: INFO
      redact: true
  fluent-servers:
    default:
      address: 127.0.0.1:5170
    other:
      channels: {WARNING: [HEALTH]}
      net: udp
      address: 127.0.0.1:5111
  stderr:
    filter: WARNING
    redact: false
    redactable: true

# Check that duplicate channels are refused.
yaml
sinks:
   stderr:
      channels: DEV,DEV
----
ERROR: duplicate channel name: "DEV"

# Check that supported permission formats are accepted.
yaml
sinks:
  file-groups:
    decimal:
      file-permissions: 222
    leadingzero:
      file-permissions: 0222
    prefix:
      file-permissions: 0o222
    quoted:
      file-permissions: "0222"
----
sinks:
  file-groups:
    decimal:
      file-permissions: "0222"
    leadingzero:
      file-permissions: "0222"
    prefix:
      file-permissions: "0222"
    quoted:
      file-permissions: "0222"

yaml
file-defaults:
  file-permissions: foobar
----
ERROR: file-permissions unparsable: foobar

yaml
file-defaults:
  file-permissions: 02222
----
ERROR: file-permissions out-of-range: 02222

yaml
file-defaults:
  file-permissions: -222
----
ERROR: file-permissions out-of-range: -222

yaml
file-defaults:
  file-permissions: 0454
----
ERROR: file-permissions must not be executable: 0454
