parallax / parallax/jsPDF

Support application specific error handler/logger

Open
#2,117 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request
Dominant language
JavaScript
Stars
31.3k
Forks
4.8k
PR merge metrics
No merged PRs in 30d

Description

Request

when I integrate jsPDF in another application, it should be possible to connect it with the application's error message / logging approach.

Proposed solution

  1. Logging is handled by a logger object

  2. logger object is a read/write property of the jspdf instance

  3. there is a default logger object which writes to the console

  4. the logger object has the methods message, error, warning, info, debug. Maybe we implement the api defined as http://log4javascript.org/

    • warning is used for situation where jspdf can work around (e.g. by proper defaults) deprecation messages would be warnings
    • error is used for serious issues such as wrong parameters etc.
    • info may be used for informational message (e.d. to expose the jspdf version) - probably not applicable for jspdf
    • debug is used to write internal information for debugging purposes
    • message is used to give messages to the user - probably not applicable for jspdf

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating jsPDF's current error, warning, and console logging paths; no files or tests are identified in the issue. Define the logger object's message, error, warning, info, and debug methods, its default console-backed behavior, and the read/write instance property, then verify existing logging still works through the selected logger.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.