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 components #709

Merged
merged 6 commits into from
Apr 12, 2024
Merged

feat: add logger components #709

merged 6 commits into from
Apr 12, 2024

Conversation

stropitek
Copy link
Contributor

Closes: #449

@stropitek stropitek linked an issue Apr 5, 2024 that may be closed by this pull request
Copy link

cloudflare-workers-and-pages bot commented Apr 5, 2024

Deploying react-science with  Cloudflare Pages  Cloudflare Pages

Latest commit: 26ad88f
Status: ✅  Deploy successful!
Preview URL: https://fcda01ba.react-science.pages.dev
Branch Preview URL: https://449-new-modal-for-logs-logge.react-science.pages.dev

View logs

@stropitek stropitek requested a review from lpatiny April 5, 2024 12:42
@stropitek
Copy link
Contributor Author

Usage:

import { FifoLogger } from 'fifo-logger';
const fifoLogger = new FifoLogger();

function App() {
  return (
    <FifoLoggerProvider logger={fifoLogger}>
      // ...
      <FifoLoggerToolbarItem />
    </FifoLoggerProvider>
  );
}

To add logs:

function ComponentAddingLogs() {
  const logger = useFifoLogger();

  // In callback / useEffect
  logger.info('info');
}

To get render something when the logs are updated:

function ComponentThatNeedsLogs() {
  const logs = useFifoLogs();
}

@stropitek
Copy link
Contributor Author

@lpatiny This PR is awaiting your review

@moonayyur can you have a look as well? Because you designed a similar component in pixelium and the goal is to replace it with this one.

Copy link
Contributor

@lpatiny lpatiny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionality LGTM but there is no storybook so it may be difficult to find this component,

@lpatiny lpatiny requested a review from moonayyur April 12, 2024 08:46
package.json Show resolved Hide resolved
@stropitek stropitek enabled auto-merge (squash) April 12, 2024 15:30
@stropitek stropitek merged commit 30b6212 into main Apr 12, 2024
12 checks passed
@stropitek stropitek deleted the 449-new-modal-for-logs-logger branch April 12, 2024 15:32
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.

New modal for logs - logger
4 participants