Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add logger to property inspector, and support multiple log targets #35

Merged
merged 10 commits into from
Apr 18, 2024

Conversation

GeekyEggo
Copy link
Member

This pull requests adds a Logger to the top-level import for the property inspector, and similar to the plugin, can be accessed via

import streamDeck from "@elgato/streamdeck";

streamDeck.logger.info("Hello world");

Additionally, it adds support for a Logger having multiple LogTarget instances, allowing for logs to be output to multiple locations, for example outputting logs to the console (when debugging is enabled) and a file.

Summary

Added

  • Add support for multiple LogTarget within Logger.
  • Add ConsoleTarget capable of logging to console.log, console.warn, and console.error.
  • Add support for logging objects directly when writing to the logger, i.e. via info(...), warn(...), etc.

Changed

  • Update Logger to have a minimumLevel responsible for defining what the minimum possible level can be.
  • Centralize Logger, and supporting objects, to the common folder, removing Node.js dependencies.

Fixed

  • Fix un-awaited promise within MessageGateway that could result in multiple responses being sent for a request.

@GeekyEggo GeekyEggo requested a review from ChekTek April 17, 2024 15:10
@GeekyEggo GeekyEggo merged commit e343a79 into main Apr 18, 2024
4 checks passed
@GeekyEggo GeekyEggo deleted the logging branch April 18, 2024 12:29
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.

2 participants