Skip to content

Commit

Permalink
Parameters is the official name, Arguments is just an alias
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Nov 28, 2023
1 parent e333d46 commit 0f93eef
Show file tree
Hide file tree
Showing 16 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ But it's way more comfortable to run it locally and catch avoidable errors befor
"""
Do something.
Arguments:
Parameters:
x: A very important parameter.
Expand Down
6 changes: 3 additions & 3 deletions src/structlog/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def _process_event(
Call it to combine your *event* and *context* into an event_dict and
process using the processor chain.
Arguments:
Parameters:
method_name:
The name of the logger method. Is passed into the processors.
Expand Down Expand Up @@ -197,7 +197,7 @@ def _proxy_to_logger(
handling :exc:`structlog.DropEvent`, and finally calls *method_name* on
:attr:`_logger` with the result.
Arguments:
Parameters:
method_name:
The name of the method that's going to get called. Technically
Expand Down Expand Up @@ -232,7 +232,7 @@ def get_context(bound_logger: BindableLogger) -> Context:
The type of *bound_logger* and the type returned depend on your
configuration.
Arguments:
Parameters:
bound_logger: The bound logger whose context you want.
Expand Down
6 changes: 3 additions & 3 deletions src/structlog/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def get_logger(*args: Any, **initial_values: Any) -> Any:
>>> log.info("hello", x=42)
y=23 x=42 event='hello'
Arguments:
Parameters:
args:
*Optional* positional arguments that are passed unmodified to the
Expand Down Expand Up @@ -169,7 +169,7 @@ def wrap_logger(
In other words: selective overwriting of the defaults while keeping some
*is* possible.
Arguments:
Parameters:
initial_values: Values that are used to pre-populate your contexts.
Expand Down Expand Up @@ -217,7 +217,7 @@ def configure(
Use `reset_defaults` to undo your changes.
Arguments:
Parameters:
processors: The processor chain. See :doc:`processors` for details.
Expand Down
2 changes: 1 addition & 1 deletion src/structlog/_frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _find_first_app_frame_and_name(
"""
Remove all intra-structlog calls and return the relevant app frame.
Arguments:
Parameters:
additional_ignores:
Additional names with which the first frame must not start.
Expand Down
2 changes: 1 addition & 1 deletion src/structlog/_log_levels.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def make_filtering_bound_logger(min_level: int) -> type[FilteringBoundLogger]:
- You *can* have (much) more fine-grained filtering by :ref:`writing a
simple processor <finer-filtering>`.
Arguments:
Parameters:
min_level:
The log level as an integer. You can use the constants from
Expand Down
12 changes: 6 additions & 6 deletions src/structlog/_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class PrintLogger:
"""
Print events into a file.
Arguments:
Parameters:
file: File to print to. (default: `sys.stdout`)
Expand Down Expand Up @@ -122,7 +122,7 @@ class PrintLoggerFactory:
To be used with `structlog.configure`\ 's ``logger_factory``.
Arguments:
Parameters:
file: File to print to. (default: `sys.stdout`)
Expand All @@ -142,7 +142,7 @@ class WriteLogger:
"""
Write events into a file.
Arguments:
Parameters:
file: File to print to. (default: `sys.stdout`)
Expand Down Expand Up @@ -232,7 +232,7 @@ class WriteLoggerFactory:
To be used with `structlog.configure`\ 's ``logger_factory``.
Arguments:
Parameters:
file: File to print to. (default: `sys.stdout`)
Expand All @@ -252,7 +252,7 @@ class BytesLogger:
r"""
Writes bytes into a file.
Arguments:
Parameters:
file: File to print to. (default: `sys.stdout`\ ``.buffer``)
Useful if you follow `current logging best practices
Expand Down Expand Up @@ -336,7 +336,7 @@ class BytesLoggerFactory:
To be used with `structlog.configure`\ 's ``logger_factory``.
Arguments:
Parameters:
file: File to print to. (default: `sys.stdout`\ ``.buffer``)
Expand Down
2 changes: 1 addition & 1 deletion src/structlog/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def until_not_interrupted(f: Callable[..., Any], *args: Any, **kw: Any) -> Any:
"""
Retry until *f* succeeds or an exception that isn't caused by EINTR occurs.
Arguments:
Parameters:
f: A callable like a function.
Expand Down
4 changes: 2 additions & 2 deletions src/structlog/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class ConsoleRenderer:
*after* the log line. If Rich_ or better-exceptions_ are present, in colors
and with extra context.
Arguments:
Parameters:
pad_event: Pad the event to this many characters.
Expand Down Expand Up @@ -527,7 +527,7 @@ def get_default_level_styles(colors: bool = True) -> Any:
my_styles["EVERYTHING_IS_ON_FIRE"] = my_styles["critical"] renderer
= ConsoleRenderer(level_styles=my_styles)
Arguments:
Parameters:
colors:
Whether to use colorful styles. This must match the *colors*
Expand Down
22 changes: 11 additions & 11 deletions src/structlog/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class KeyValueRenderer:
"""
Render ``event_dict`` as a list of ``Key=repr(Value)`` pairs.
Arguments:
Parameters:
sort_keys: Whether to sort keys when formatting.
Expand Down Expand Up @@ -119,7 +119,7 @@ class LogfmtRenderer:
.. _logfmt: https://brandur.org/logfmt
Arguments:
Parameters:
sort_keys: Whether to sort keys when formatting.
Expand Down Expand Up @@ -237,7 +237,7 @@ class UnicodeEncoder:
"""
Encode unicode values in ``event_dict``.
Arguments:
Parameters:
encoding: Encoding to encode to (default: ``"utf-8"``).
Expand Down Expand Up @@ -272,7 +272,7 @@ class UnicodeDecoder:
"""
Decode byte string values in ``event_dict``.
Arguments:
Parameters:
encoding: Encoding to decode from (default: ``"utf-8"``).
Expand Down Expand Up @@ -308,7 +308,7 @@ class JSONRenderer:
"""
Render the ``event_dict`` using ``serializer(event_dict, **dumps_kw)``.
Arguments:
Parameters:
dumps_kw:
Are passed unmodified to *serializer*. If *default* is passed, it
Expand Down Expand Up @@ -385,7 +385,7 @@ class ExceptionRenderer:
If there is no ``exc_info`` key, the *event_dict* is not touched. This
behavior is analog to the one of the stdlib's logging.
Arguments:
Parameters:
exception_formatter:
A callable that is used to format the exception from the
Expand Down Expand Up @@ -459,7 +459,7 @@ class TimeStamper:
"""
Add a timestamp to ``event_dict``.
Arguments:
Parameters:
fmt:
strftime format string, or ``"iso"`` for `ISO 8601
Expand Down Expand Up @@ -608,7 +608,7 @@ class ExceptionPrettyPrinter:
"""
Pretty print exceptions and remove them from the ``event_dict``.
Arguments:
Parameters:
file: Target file for output (default: ``sys.stdout``).
Expand Down Expand Up @@ -661,7 +661,7 @@ class StackInfoRenderer:
involving an exception and works analogously to the *stack_info* argument
of the Python standard library logging.
Arguments:
Parameters:
additional_ignores:
By default, stack frames coming from *structlog* are ignored. With
Expand Down Expand Up @@ -745,7 +745,7 @@ class CallsiteParameterAdder:
The keys used for callsite parameters in the event dictionary are the
string values of `CallsiteParameter` enum members.
Arguments:
Parameters:
parameters:
A collection of `CallsiteParameter` values that should be added to
Expand Down Expand Up @@ -880,7 +880,7 @@ class EventRenamer:
some processors may rely on the presence and meaning of the ``event``
key.
Arguments:
Parameters:
to: Rename ``event_dict["event"]`` to ``event_dict[to]``
Expand Down
8 changes: 4 additions & 4 deletions src/structlog/stdlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def recreate_defaults(*, log_level: int | None = logging.NOTSET) -> None:
As with vanilla defaults, the backwards-compatibility guarantees don't
apply to the settings applied here.
Arguments:
Parameters:
log_level:
If `None`, don't configure standard library logging **at all**.
Expand Down Expand Up @@ -655,7 +655,7 @@ class LoggerFactory:
>>> from structlog.stdlib import LoggerFactory
>>> configure(logger_factory=LoggerFactory())
Arguments:
Parameters:
ignore_frame_names:
When guessing the name of a logger, skip frames whose names *start*
Expand Down Expand Up @@ -814,7 +814,7 @@ class ExtraAdder:
This processor can be used for adding data passed in the ``extra``
parameter of the `logging` module's log methods to the event dictionary.
Arguments:
Parameters:
allow:
An optional collection of attributes that, if present in
Expand Down Expand Up @@ -906,7 +906,7 @@ class ProcessorFormatter(logging.Formatter):
Please refer to :ref:`processor-formatter` for examples.
Arguments:
Parameters:
foreign_pre_chain:
If not `None`, it is used as a processor chain that is applied to
Expand Down
2 changes: 1 addition & 1 deletion src/structlog/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class CapturedCall(NamedTuple):
Can also be unpacked like a tuple.
Arguments:
Parameters:
method_name: The method name that got called.
Expand Down
4 changes: 2 additions & 2 deletions src/structlog/threadlocal.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def wrap_dict(dict_class: type[Context]) -> type[Context]:
The wrapped class and used to keep global in the current thread.
Arguments:
Parameters:
dict_class: Class used for keeping context.
Expand All @@ -106,7 +106,7 @@ def as_immutable(logger: TLLogger) -> TLLogger:
"""
Extract the context from a thread local logger into an immutable logger.
Arguments:
Parameters:
logger (structlog.typing.BindableLogger):
A logger with *possibly* thread local state.
Expand Down
4 changes: 2 additions & 2 deletions src/structlog/tracebacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def extract(
"""
Extract traceback information.
Arguments:
Parameters:
exc_type: Exception type.
Expand Down Expand Up @@ -220,7 +220,7 @@ class ExceptionDictTransformer:
These dictionaries are based on :class:`Stack` instances generated by
:func:`extract()` and can be dumped to JSON.
Arguments:
Parameters:
show_locals:
Whether or not to include the values of a stack frame's local
Expand Down
6 changes: 3 additions & 3 deletions src/structlog/twisted.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class PlainFileLogObserver:
Great to just print JSON to stdout where you catch it with something like
runit.
Arguments:
Parameters:
file: File to print to.
Expand All @@ -229,7 +229,7 @@ class JSONLogObserverWrapper:
"""
Wrap a log *observer* and render non-`JSONRenderer` entries to JSON.
Arguments:
Parameters:
observer (ILogObserver):
Twisted log observer to wrap. For example
Expand Down Expand Up @@ -293,7 +293,7 @@ class EventAdapter:
<https://docs.twisted.org/en/stable/api/twisted.python.log.html#err>`_
behave as expected.
Arguments:
Parameters:
dictRenderer:
Renderer that is used for the actual log message. Please note that
Expand Down
2 changes: 1 addition & 1 deletion src/structlog/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class ExceptionTransformer(Protocol):
Used by `structlog.processors.format_exc_info()` and
`structlog.processors.ExceptionPrettyPrinter`.
Arguments:
Parameters:
exc_info: Is the exception tuple to format
Expand Down
Loading

0 comments on commit 0f93eef

Please sign in to comment.