Skip to content

Conversation

@webJose
Copy link
Contributor

@webJose webJose commented Sep 7, 2025

Fixes #54

@webJose webJose requested a review from Copilot September 7, 2025 17:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a global logger object to the routing library, allowing users to control logging behavior during initialization. The logger can be disabled, use the default console, or accept a custom logger implementation.

  • Adds an ILogger interface defining the required logging methods (debug, log, warn, error)
  • Implements a configurable logger system with support for boolean flags and custom logger objects
  • Updates existing code to use the new logger instead of direct console calls

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/lib/types.ts Defines the ILogger interface with required logging methods
src/lib/index.ts Adds logger option to InitOptions and calls setLogger during initialization
src/lib/core/Logger.ts Implements the logger system with stock, off, and custom logger support
src/lib/core/Logger.test.ts Comprehensive test coverage for the logger functionality
src/lib/core/LocationState.svelte.ts Updates warning message to use the new logger
src/lib/core/LocationState.svelte.test.ts Updates test to mock the new logger instead of console
src/lib/core/LocationFull.ts Updates warning message to use the new logger

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@webJose webJose merged commit 4464e3d into main Sep 7, 2025
1 check passed
@webJose webJose deleted the JP/Logger branch September 7, 2025 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add global, configurable logger object

2 participants