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

SKYOPS-73008 #55

Merged
merged 2 commits into from
May 27, 2024
Merged

SKYOPS-73008 #55

merged 2 commits into from
May 27, 2024

Conversation

MaciejZurekk
Copy link
Contributor

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • 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 change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

codecov bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (fc4c9b5) to head (2712ba8).

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #55   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            3         3           
  Lines          132       132           
  Branches        24        24           
=========================================
  Hits           132       132           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@shazron shazron left a comment

Choose a reason for hiding this comment

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

See our tests for DEBUG usage. This is a limitation of our use of the popular debug npm module which has no concept of log levels.

In general, if you use the debug log provider (not the default), you will have set AIO_LOG_LEVEL as normal, and also set DEBUG env var to your module name (which cannot have spaces). For the winston log provider, you only set AIO_LOG_LEVEL.

e.g in your code:

const logger = require('@adobe/aio-lib-core-logging')('MyModuleName', { provider: 'debug' })
logger.info('info')
logger.debug('debug')

... to see both logs, you would do:

AIO_LOG_LEVEL=debug
DEBUG=MyModuleName

Yes, we know it is not consistent: #6

You can also set the log level to be from whatever config you want, in this case, I set it to another env var:

e.g.

const logger = require('@adobe/aio-lib-core-logging')('MyModuleName', { provider: 'debug', level: process.env.FOOBAR })
logger.info('info')
logger.debug('debug')

@MaciejZurekk
Copy link
Contributor Author

I made changes.

@shazron shazron merged commit 3fcd2a6 into adobe:master May 27, 2024
8 checks passed
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.

None yet

3 participants