API Reference

logger

Styled logging utility available globally in glyria.js.

Overview

logger is glyria.js's internal logging utility.

logger.info("MyModule", "Initializing...")
logger.success("MyModule", "Ready!")

It produces messages consistent with the framework's visual style, automatically aligned and colored in the terminal.

logger is available globally — no import needed.

Methods

logger.info(scope, message)

Displays an informational message in cyan.

logger.info("Database", "Connecting...")
│ ℹ Database      Connecting...
ParameterTypeDescription
scopestringModule name or message context
messagestringMessage to display

logger.success(scope, message)

Displays a success message in green.

logger.success("Database", "Connected to PostgreSQL")
├─ ✔ Database      Connected to PostgreSQL
ParameterTypeDescription
scopestringModule name or message context
messagestringMessage to display

logger.warn(scope, message)

Displays a warning in yellow.

logger.warn("Cache", "Key expired, reloading...")
├─ ⚠ Cache         Key expired, reloading...
ParameterTypeDescription
scopestringModule name or message context
messagestringMessage to display

logger.error(scope, message)

Displays an error in red.

logger.error("Redis", "Connection failed")
├─ ✖ Redis         Connection failed
ParameterTypeDescription
scopestringModule name or message context
messagestringMessage to display

logger.hotreload(scope, message)

Displays a hot reload message in magenta. Used internally by the watcher, but available if you implement your own reload logic.

logger.hotreload("Commands", "ping.ts reloaded")
├─ 🔥 Commands      ping.ts reloaded
ParameterTypeDescription
scopestringModule name or message context
messagestringMessage to display

logger.ready(botName)

Displays the bot connection message. Called automatically by glyria.js on startup — you don't need to call this manually.

logger.ready("MyBot#1234")
│
╰─ ⚡ bot           Ready as MyBot#1234
ParameterTypeDescription
botNamestringBot name and discriminator

Full example

Typical usage in a src/utils/database.ts file auto-imported by glyria.js:

export const prisma = new PrismaClient()

export const init = async () => {
  try {
    await prisma.$connect()
    logger.success("Database", "Connected to PostgreSQL")
  } catch (error) {
    logger.error("Database", "Connection failed")
    throw error
  }
}
export const redis = createClient({ url: process.env.REDIS_URL })

export const init = async () => {
  try {
    await redis.connect()
    logger.success("Redis", "Connected")
  } catch (error) {
    logger.error("Redis", "Connection failed")
    throw error
  }
}

The init hook is automatically called by glyria.js during auto-import — see Auto Imports. ::


Conventions

The scope parameter is automatically padded to 12 characters to visually align messages in the terminal. Keep it short and explicit:

GoodAvoid
"Database""Database initialization"
"Redis""Redis cache"
"Commands""Commands manager"
Copyright © 2026