Class: LogStruct::ConfigStruct::Limits

Inherits:
T::Struct
  • Object
show all
Includes:
Sorbet::SerializeSymbolKeys
Defined in:
lib/log_struct/config_struct/limits.rb

Overview

How much of each logged value LogStruct writes. The limits keep a huge value (a request body, a large Hash) from slowing down the thread that writes the logs.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Sorbet::SerializeSymbolKeys

#serialize, #to_h

Constructor Details

#initialize(max_hash_keys: 100, max_array_items: 10, max_backtrace_lines: 20, max_string_bytes: 32_768) ⇒ void

Parameters:

  • max_hash_keys (Integer) (defaults to: 100) —

    The most keys written from a Hash. The rest are counted in _more_keys. Default: 100

  • max_array_items (Integer) (defaults to: 10) —

    The most items written from an Array, followed by "... and N more items" Default: 10

  • max_backtrace_lines (Integer) (defaults to: 20) —

    The most lines written from an Array that looks like a backtrace, such as an error line's backtrace. The rest are counted in a last "... and N more lines" item. Default: 20

  • max_string_bytes (Integer) (defaults to: 32_768) —

    Strings longer than this many bytes are cut, and say how long they were Default: 32768 (32 KB)



# File ''

prop :max_hash_keys, Integer, default: 100
prop :max_array_items, Integer, default: 10
prop :max_backtrace_lines, Integer, default: 20
prop :max_string_bytes, Integer, default: 32_768

Instance Attribute Details

#max_array_items ⇒ Integer

The most items written from an Array, followed by "... and N more items" Default: 10

Returns:

  • (Integer)


# File ''

prop :max_array_items, Integer, default: 10

#max_backtrace_lines ⇒ Integer

The most lines written from an Array that looks like a backtrace, such as an error line's backtrace. The rest are counted in a last "... and N more lines" item. Default: 20

Returns:

  • (Integer)


# File ''

prop :max_backtrace_lines, Integer, default: 20

#max_hash_keys ⇒ Integer

The most keys written from a Hash. The rest are counted in _more_keys. Default: 100

Returns:

  • (Integer)


# File ''

prop :max_hash_keys, Integer, default: 100

#max_string_bytes ⇒ Integer

Strings longer than this many bytes are cut, and say how long they were Default: 32768 (32 KB)

Returns:

  • (Integer)


# File ''

prop :max_string_bytes, Integer, default: 32_768