Skip to content

feat: Introduce CodecheckLogger wrapper class for levelled logging#124

Open
subhanLabs wants to merge 1 commit into
mainfrom
feature/logging-framework
Open

feat: Introduce CodecheckLogger wrapper class for levelled logging#124
subhanLabs wants to merge 1 commit into
mainfrom
feature/logging-framework

Conversation

@subhanLabs
Copy link
Copy Markdown
Member

Closes #85

What this PR does

Introduces a simple CodecheckLogger wrapper class that replaces all error_log() calls across the plugin with consistent, levelled logging.

Changes

  • Added classes/Log/CodecheckLogger.php with three log levels: debug, info, error
  • Replaced all error_log() calls in:
    • CodecheckPlugin.php
    • api/v1/CodecheckApiHandler.php
    • classes/CodecheckRegister/CodecheckVenueTypes.php
    • classes/CodecheckRegister/CodecheckVenueNames.php
    • classes/CodecheckRegister/CertificateIdentifierList.php

Log format

All messages are prefixed with [codecheck] and the level, e.g.:

[codecheck][debug] register() called, path=plugins/generic/codecheck
[codecheck][info] Upload file for submission: 5
[codecheck][error] YAML Parse Exception: ...

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.

Logging framework

1 participant