Skip to content

chore: use common logger class #1529

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

Merged
merged 3 commits into from
Jul 10, 2024
Merged

Conversation

eglitise
Copy link
Collaborator

@eglitise eglitise commented Jul 10, 2024

This PR adds a basic Logger class for abstracting away some logging implementations for better maintenance. The class itself still executes basic console calls under the hood, but this can be improved in the future.
The following logging implementations have been replaced with Logger:

  • All uses of console in common files
  • All uses of the log method imported from the shared polyfills file (there were only 2 such instances)
    • The browser polyfill still used console, so there is no difference
    • The Electron polyfill used electron-log, so this dependency has been removed

The actual main goal of this PR is to remove electron-log, as it is only being called in the renderer process anyway, and also it was causing issues for the Vite migration.

@github-actions github-actions bot added chore Internal changes not visible to the user dependencies Dependency updates, removals or additions labels Jul 10, 2024
@mykola-mokhnach
Copy link
Contributor

You may also reuse the logger from the main monorepo: @appium/logger. This should save some lines of code

@eglitise
Copy link
Collaborator Author

Indeed, using @appium/logger was actually my first choice, but since it uses node: imports which are not supported by the current Electron version, it was not an option.

@eglitise eglitise requested a review from mykola-mokhnach July 10, 2024 14:38
@eglitise eglitise merged commit 6478f3c into appium:main Jul 10, 2024
7 checks passed
@eglitise eglitise deleted the use-common-logger branch July 10, 2024 16:21
laib3 pushed a commit to laib3/appium-inspector that referenced this pull request Nov 16, 2024
* chore: use common logger class

* chore: formatting

* chore: move logger to separate module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Internal changes not visible to the user dependencies Dependency updates, removals or additions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants