Security News
Highlights from the 2024 Rails Community Survey
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
@amazebot/logger
Advanced tools
When building dependencies of more complex apps, you don't want to be too
opinionated about how logs are written, nor add more dependencies that might not
play with choices made in the app. However, you also don't want to hard code
console.log
and end up with multiple output streams.
This package provides standard logging methods for packages requiring it. They route to console.log by default, but apps requiring those packages can pass in their own log utility, to overwrite the default methods (as long as the logger instance is exported).
import { logger } from '@amazebot/logger'
Provides standard debug/info/warning/error methods
export const pkgLogger = logger
pkgLogger.info(`That's pretty much it.`)
Outputs to console by default, but allows override.
import { logger } from 'amazing-logger'
import * as myPackage from 'my-package'
myPackage.logger.replace(logger)
Routes to debug/info/warning/error of new interface.
import { silence } from '@amazebot/logger'
describe('test methods that log', () => {
before(() => silence())
after(() => silence(false))
})
Routes debug/info/warning/error to null output.
FAQs
Basic log handling with overrides for use within other modules.
The npm package @amazebot/logger receives a total of 1 weekly downloads. As such, @amazebot/logger popularity was classified as not popular.
We found that @amazebot/logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.