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

fix: fixed logger console output #58

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

FibrinLab
Copy link

Resolves #57

Fixes Implemented:

  1. Prevents duplicate logs
    _logWithStack() previously logged message, metadata, and stack separately, causing redundant entries.
    Now, everything is logged in a single structured output.

  2. Metadata is correctly formatted
    Metadata strings were previously concatenated directly to the message.
    Now, metadata appears on a new line, making logs easier to read.

Thanks, Let me know if any changes are needed! 🚀

@0x4007
Copy link
Member

0x4007 commented Feb 6, 2025

I can't really tell what the correct log style is supposed to look like but here are the logs in the test

https://github.com/ubiquity-os/ubiquity-os-logger/actions/runs/13182552917/job/36796717219#step:4:1

@0x4007 0x4007 removed their request for review February 6, 2025 17:02
@gentlementlegen
Copy link
Member

I tried to use it and having logger.error still shows an empty section for error:

        ⚠ Some error
          
          {
            "error": {},
            "caller": "<anonymous>"
          }
          
          Error: Error!
              at <anonymous> (/Users/mentlegen/WebstormProjects/ubiquibot-logger/src/test.ts:6:9)
              at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
              at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
              at async loadESM (node:internal/process/esm_loader:34:7)
              at async handleMainPromise (node:internal/modules/run_main:113:12)

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.

Logger console output
3 participants