Skip to content

michael-slx/LogScribe

Repository files navigation

LogScribe

A modern, flexible, and extensible logging framework for JavaScript and TypeScript applications.

⚠️ Warning: Early Work-in-Progress

This project is in early development stages. APIs may change without notice, and not all features are fully implemented yet. Do not use in production environments.

Overview

LogScribe is a comprehensive logging system designed to provide powerful logging capabilities for both client-side and server-side JavaScript/TypeScript applications. It offers a flexible architecture that allows for customization and extension to meet various logging needs.

Project Structure

LogScribe is organized as a monorepo using pnpm workspaces, containing the following packages:

  • @logscribe/api: Defines the core interfaces and types for the logging system
  • @logscribe/core: Implements the core logging functionality
  • @logscribe/server: Provides server-side integration for the logging system

Key Features

  • Multiple log levels (TRACE, DEBUG, INFO, NOTICE, WARNING, ERROR, FATAL)
  • Various appenders for different output destinations:
    • Console appender for browser/Node.js console output
    • File appender for writing logs to files
    • Terminal appender with color support
    • HTTP appender for sending logs to a remote endpoint
    • Null appender for disabling logging
  • Customizable message formatting
  • Hierarchical logger configuration
  • Asynchronous logging support
  • TypeScript-first design with full type safety

Getting Started

import { setUpLogging, consoleAppender } from "@logscribe/core";
import { LogLevel } from "@logscribe/api";

// Set up logging with console output
const [loggerFactory, shutdown] = await setUpLogging({
    rootLevel: LogLevel.INFO,
    appenders: [consoleAppender()]
});

// Create a logger
const logger = loggerFactory.createLogger("myApp");

// Log messages at different levels
logger.info("Application started");
logger.debug("This won't be logged because DEBUG < INFO");
logger.error("Something went wrong", new Error("Details here"));

// Shutdown logging when done
await shutdown();

Development

See the guidelines.md file for detailed development guidelines, including:

  • Code style and linting
  • Commit message format
  • Documentation standards
  • Testing approach
  • Package exports and imports

License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright (c) 2025 Michael Schantl & contributors

About

A modern, flexible, and extensible logging framework for JavaScript and TypeScript applications.

Topics

Resources

License

Stars

Watchers

Forks