
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@luckyorange/utilities-cron-logger
Advanced tools
LuckyLogger is a lightweight logging utility built specifically for cron jobs.
It uses Google Cloud Logging and can optionally patch console.log
, console.error
, etc. to log to GCP automatically.
console
methods to log to GCPnpm 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, options = {})
Parameter | Type | Default | Description |
---|---|---|---|
cronName | string | (required) | Name of the cron job (used for the log name and container name) |
options | object | {} | Configuration options (see below) |
Option | Type | Default | Description |
---|---|---|---|
minLogLevel | string | 'INFO' | Minimum severity to log (DEBUG , INFO , WARNING , ERROR , CRITICAL ) |
patchConsole | boolean | false | Whether to patch console.log , console.warn , etc. to log to GCP |
Basic usage with defaults:
const logger = new LuckyLogger('session-count-check')
With options:
const logger = new LuckyLogger('session-count-check', {
minLogLevel: 'ERROR',
patchConsole: true
})
Just enabling console patching:
const logger = new LuckyLogger('session-count-check', { patchConsole: true })
console.log('This logs to both the terminal and Google Cloud Logging')
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 additional information (e.g., IDs, counts, etc.)If you enabled patchConsole
and later want to undo it:
logger.restoreConsole()
console.log('Now this logs only to the terminal')
HOSTNAME
— auto-populated in Buddy; used as the pod_name
CONTAINER_NAME
— auto-populated in Buddy or container environmentsconst LuckyLogger = require('@luckyorange/utilities-cron-logger')
const logger = new LuckyLogger('session-count-check', {
minLogLevel: 'INFO',
patchConsole: true
})
logger.info('Cron started')
console.warn('This is also sent to GCP because patchConsole is enabled')
try {
logger.debug('Fetched session data', { sessions: 500 })
} catch (error) {
logger.error('Error during cron execution', { error: error.message })
}
If you enable patchConsole
, you can later restore the original console
methods to stop logging to Google Cloud.
const LuckyLogger = require('@luckyorange/utilities-cron-logger')
// Enable console patching
const logger = new LuckyLogger('session-count-check', { patchConsole: true })
console.log('This goes to both terminal and GCP')
// Restore original console behavior
logger.restoreConsole()
console.log('This now logs to terminal only')
This is useful if you only want GCP logging during certain phases of a script, or for fine-grained control in tests, parallel jobs, or debugging.
Internal use only — property of Lucky Orange
FAQs
More helpful log messages for cron jobs
The npm package @luckyorange/utilities-cron-logger receives a total of 3 weekly downloads. As such, @luckyorange/utilities-cron-logger popularity was classified as not popular.
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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.