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

Feature/lit 305 additional explicit log levels #325

Conversation

cipherzzz
Copy link

Description

Resolves #305

I added additional log levels and reorganized existing to make it consistent

Changes to Existing

  • changed log to logDebug method Signature
  • changed 'logWithRequestIdtologDebugWithRequestId`
  • updated all references for changed method signatures above
  • added a simple test to misc

Added

  • added logInfo and logInfoWithRequestId
  • added logTrace and logTraceWithRequestId
  • added logWarn and logWarnWithRequestId

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

I added the following test to misc.spec.ts

  it('should have debug, info, trace, warn, and error functions', () => {
    expect(utilsModule.logDebug).toBeDefined();
    expect(utilsModule.logDebugWithRequestId).toBeDefined();
    expect(utilsModule.logInfo).toBeDefined();
    expect(utilsModule.logInfoWithRequestId).toBeDefined();
    expect(utilsModule.logTrace).toBeDefined();
    expect(utilsModule.logTraceWithRequestId).toBeDefined();
    expect(utilsModule.logWarn).toBeDefined();
    expect(utilsModule.logWarnWithRequestId).toBeDefined();
    expect(utilsModule.logError).toBeDefined();
    expect(utilsModule.logErrorWithRequestId).toBeDefined();
  });

yarn nx run misc:build Succeeds
yarn nx run misc:test Succeeds

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@cipherzzz cipherzzz marked this pull request as draft January 25, 2024 17:07
@cipherzzz
Copy link
Author

@joshLong145 - I made the changes but I'm not able to yarn build the whole project. It fails on
nx run lit-auth-client:build with the error(s)

- Building Tsc...
node:internal/errors:863
  const err = new Error(message);
              ^

Error: Command failed: yarn nx run misc-browser:_buildTsc
packages/misc-browser/src/lib/misc-browser.ts:13:46 - error TS2315: Type 'IEither' is not generic.

13 export const getStorageItem = (key: string): IEither<string> => {
                                                ~~~~~~~~~~~~~~~
packages/misc-browser/src/lib/misc-browser.ts:39:61 - error TS2315: Type 'IEither' is not generic.

Obviously, this isn't related to my change

@CLAassistant
Copy link

CLAassistant commented Jan 25, 2024

CLA assistant check
All committers have signed the CLA.

@joshLong145
Copy link

joshLong145 commented Jan 27, 2024

@cipherzzz
Thank you for getting this done! looking at the additions I think we are mostly good here.
I went ahead and updated the branch on your fork to our latest master I was able to fully build and test out the changes.
what is your NodeJS and Yarn versions
I am using
node: 18.16
yarn: 1.22.19

make sure you are using node version 18 as there can be issues with dependency install if not using 18

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.

Create New Logging level uitlities
4 participants