logger
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...
| Parameter | Type | Description |
|---|---|---|
scope | string | Module name or message context |
message | string | Message to display |
logger.success(scope, message)
Displays a success message in green.
logger.success("Database", "Connected to PostgreSQL")
├─ ✔ Database Connected to PostgreSQL
| Parameter | Type | Description |
|---|---|---|
scope | string | Module name or message context |
message | string | Message to display |
logger.warn(scope, message)
Displays a warning in yellow.
logger.warn("Cache", "Key expired, reloading...")
├─ ⚠ Cache Key expired, reloading...
| Parameter | Type | Description |
|---|---|---|
scope | string | Module name or message context |
message | string | Message to display |
logger.error(scope, message)
Displays an error in red.
logger.error("Redis", "Connection failed")
├─ ✖ Redis Connection failed
| Parameter | Type | Description |
|---|---|---|
scope | string | Module name or message context |
message | string | Message 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
| Parameter | Type | Description |
|---|---|---|
scope | string | Module name or message context |
message | string | Message 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
| Parameter | Type | Description |
|---|---|---|
botName | string | Bot 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:
| Good | Avoid |
|---|---|
"Database" | "Database initialization" |
"Redis" | "Redis cache" |
"Commands" | "Commands manager" |

