
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@gloxy/logger
Advanced tools
A debug.js based namespaced logging utility with predefined log types(debug, info, warn, error) and supporting title-scoped logging, available in both web browsers and Node.js.


A debug.js-based logging utility:
debug, info, warn, error);npm install @gloxy/logger
# or
yarn add @gloxy/logger
# or
pnpm add @gloxy/logger
The only parameter namespace (e.g., 'myapp') helps distinguish these logs from other prints on Browser DevTool Consoles or Terminals.
import { createLogger } from '@gloxy/logger'
const logger = createLogger('myapp')
Logger includes 4 types of logging: debug, info, warn, and error, which use the respective console methods under the hood of the browsers and Node.js.
logger.info('Ball player %s is performing well', 'Mary')
// myapp:info Ball player Mary is performing well +0ms
You can create title-scoped logger logger(<title>), especially useful for module files.
/* ./logger.js */
import { createLogger } from '@gloxy/logger'
export const logger = createLogger('myapp')
/* ./foo.js */
import { logger } from './logger'
const log = logger('foo')
log.info('Ball player %s is performing well', 'Mary')
// myapp:info [foo] Ball player Mary is performing well +0ms
/* ./bar.js */
import { logger } from './logger'
const log = logger('bar')
log.info('Ball player %s is performing well', 'Mary')
// myapp:info [bar] Ball player Mary is performing well +0ms
Logger is disabled by default. You can enable all log types (*) or one of them(debug, info, warn, and error) by setting name (namespace:type), or multiple types (separated with commas, namespace:type1,namespace:type2). Refer to debug.js.
Note:
enable()completely overrides the previous enabled setting.
To enable the logger:
localStorage.logger = 'myapp:*'LOGGER=myapp:*Specify a type to enable the single type of logger, e.g, myapp:error.
Disable logger by removing these settings.
import { disable, enable } from '@gloxy/logger'
enable('myapp:*')
disable()
Logger supports 4 levels. You can enable multiple log types by enabling a level (namespace:level).
errorerror, warnerror, warn, infoerror, warn, info, debugFor example, enable level 2 to output only critical error and warning logs in producation.
if (import.meta.env.NODE_ENV === 'producation') {
enable('myapp:2')
}
👤 GloryWong
Give a ⭐️ if this project helped you!
FAQs
A debug.js based namespaced logging utility with predefined log types(debug, info, warn, error) and supporting title-scoped logging, available in both web browsers and Node.js.
We found that @gloxy/logger demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.