Skip to content

New logging API + debug logger management as a higher-order React component. - #8

Open
alanchwong wants to merge 2 commits into
masterfrom
debug-logging
Open

New logging API + debug logger management as a higher-order React component.#8
alanchwong wants to merge 2 commits into
masterfrom
debug-logging

Conversation

@alanchwong

Copy link
Copy Markdown
Owner

Introduces a WithDebugLogging higher-order component that wraps the Aqueductulous component to own the responsibility of parsing query string parameters and initializing logging.

The logging API has been changed to accept an object with (so far) three possible properties: title, message, and valuesMap. These three properties imply a semantic meaning to different pieces of logging data: a descriptive title to the event being logged, a static string logging message, and a set of key-value pairs to log. Any combination of these can be present in the object and the logging function will output to console appropriately. This makes the logging API more flexible as consumers can compose a single log statement containing different logging data, and removes the need to pass around a fake enumeration to describe the supplied logging data.

Debug logging is now initialized by the WithDebugLogging component wrapping the Aqueductulous component. This places the responsibility of parsing the query string parameters inside the WithDebugLogging module rather than Aqueductulous. The default export of Aqueductulous.js is now the Aqueductulous component wrapped by WithDebugLogging.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant