
Security News
Vite+ Joins the Push to Consolidate JavaScript Tooling
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
@luckyorange/utilities-cron-logger
Advanced tools
LuckyLogger is a lightweight logging utility built specifically for cron jobs. It uses Google Cloud Logging.
npm install @luckyorange/utilities-cron-logger
const LuckyLogger = require('@luckyorange/utilities-cron-logger')
// Initialize with the name of your cron job
const logger = new LuckyLogger('session-count-check')
logger.info('Starting session count check')
logger.debug('Session count details', { sessionCount: 42 })
logger.warn('Session count is lower than expected')
logger.error('Failed to fetch session data')
logger.critical('Session service unreachable')
new LuckyLogger(cronName, minLogLevel)
Parameter | Type | Default | Description |
---|---|---|---|
cronName | string | (required) | Name of the cron job (used for the log name and container name) |
minLogLevel | string | 'INFO' | Minimum severity to log (DEBUG , INFO , WARNING , ERROR , CRITICAL ) |
Example:
const logger = new LuckyLogger('session-count-check', 'WARNING')
(This would log only warnings and errors, not info or debug messages.)
Each method corresponds to a severity level in Google Cloud Logging:
Method | Severity |
---|---|
logger.debug(message, metadata) | DEBUG |
logger.info(message, metadata) | INFO |
logger.warn(message, metadata) | WARNING |
logger.error(message, metadata) | ERROR |
logger.critical(message, metadata) | CRITICAL |
message
— a string describing the log eventmetadata
— (optional) an object with any additional information you want to logHOSTNAME
— (auto-populated in Buddy) used as the pod_name
CONTAINER_NAME
— (auto-populated in Buddy)const LuckyLogger = require('@luckyorange/utilities-cron-logger')
const logger = new LuckyLogger('session-count-check')
logger.info('Cron started')
try {
logger.debug('Fetched session data', { sessions: 500 })
} catch (error) {
logger.error('Error during cron execution', { error: error.message })
}
Internal use only — property of Lucky Orange.
FAQs
More helpful log messages for cron jobs
We found that @luckyorange/utilities-cron-logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers 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
Evan You announces Vite+, a commercial, Rust-powered toolchain built on the Vite ecosystem to unify JavaScript development and fund open source.
Security News
Ruby Central’s incident report on the RubyGems.org access dispute sparks backlash from former maintainers and renewed debate over project governance.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.