Commit graph

82 commits

Author SHA1 Message Date
Tiara Rodney
6fd8c22ceb
feat(handler): implement LocalStorageHandler with rotation 2026-03-14 04:55:37 +01:00
Tiara Rodney
7479931714
todo(13): in-progress 2026-03-14 04:39:24 +01:00
Tiara Rodney
768ff9263d
Merge branch 'feature/10' into dev 2026-03-14 04:34:13 +01:00
Tiara Rodney
b254922d3c
todo(10): done 2026-03-14 04:34:08 +01:00
Tiara Rodney
1a74f2afa4
docs: add user guide, cookbook, and rewrite README 2026-03-14 04:33:53 +01:00
Tiara Rodney
741b959820
todo(10): in-progress 2026-03-14 02:34:31 +01:00
Tiara Rodney
e50fccff8f
Merge branch 'feature/9' into dev 2026-03-14 02:32:40 +01:00
Tiara Rodney
743e8ffc3b
todo(9): done 2026-03-14 02:32:35 +01:00
Tiara Rodney
5022a1e0bc
test(manager): add tests for manager assignment and propagation 2026-03-14 02:32:20 +01:00
Tiara Rodney
94c7d4a1da
feat(manager): set manager on created loggers, fix clear for placeholders
getLogger() now assigns manager on newly created loggers so
isEnabledFor can check manager.disable. When replacing a Placeholder,
_fixupParents is also called to establish the parent chain. clear()
skips Placeholder entries that lack a clear method.
2026-03-14 00:23:09 +01:00
Tiara Rodney
cfda9902f7
todo(9): in-progress
Set manager on loggers created by getLogger(), verify propagation
works end-to-end through the hierarchy.
2026-03-14 00:11:36 +01:00
Tiara Rodney
1d5ded82ba
Merge branch 'feature/8' into dev 2026-03-14 00:00:50 +01:00
Tiara Rodney
672b692013
todo(8): done
Added browser-compatible Writable interface with ConsoleWritable and
StderrWritable implementations. StreamHandler.emit() writes to a
Writable stream. ConsoleHandler maps levels to console.warn/error/log.
StderrHandler emits via console.error. FileHandler throws on
construction in browser. Handler.handleError() logs diagnostics.
Writable interface designed for extensibility (issue 13).
2026-03-14 00:00:50 +01:00
Tiara Rodney
216d2b5892
test(handler): add tests for StreamHandler, ConsoleHandler, StderrHandler
Cover StreamHandler emit to custom Writable, default stream fallback,
and error handling on write failure. Cover ConsoleHandler level-to-
method mapping (error/warn/log). Cover StderrHandler console.error
output. Cover FileHandler browser rejection. Cover Handler base class
handleError not throwing.
2026-03-14 00:00:34 +01:00
Tiara Rodney
3a6332a855
feat(handler): implement StreamHandler, ConsoleHandler, StderrHandler emit
StreamHandler.emit() writes formatted output to a Writable stream.
ConsoleHandler maps log levels to console.warn/error/log. StderrHandler
emits via console.error. handleError() logs diagnostics instead of
throwing. FileHandler throws NotImplementedError on construction.
Removed Node.js stream import and conditional require() block.
2026-03-13 23:57:37 +01:00
Tiara Rodney
e6b7f02166
feat(helper/stream): add browser-compatible Writable interface
Define Writable interface, ConsoleWritable (console.log), and
StderrWritable (console.error) as browser-safe stream abstractions.
Export DEFAULT_STREAM backed by StderrWritable to match Python's
sys.stderr default.
2026-03-13 23:29:09 +01:00
Tiara Rodney
c297bb4499
todo(8): in-progress
Implement StreamHandler.emit(), ConsoleHandler for browser console
API, and a browser-compatible stream abstraction. Design handler
base with issue 13 (localStorage handler) in mind.
2026-03-13 23:27:50 +01:00
Tiara Rodney
1cab520ba1
Merge branch 'feature/7' into dev 2026-03-13 23:26:40 +01:00
Tiara Rodney
67803747c4
todo(7): done
Implemented %-style field substitution in PercentFormatterStyle,
JS Date-based formatTime with strftime token support and ISO8601
fallback, Error.stack-based formatError, and LogRecord.getMessage.
Added message, name, msg, args fields to LogRecord.
2026-03-13 23:26:39 +01:00
Tiara Rodney
3422cfb799
test(formatter): add tests for formatting, formatTime, formatError
Cover %-style substitution with %(name)s, %(levelno)d, %(levelname)s,
multiple placeholders, unknown field errors, asctime population,
ISO8601 and custom datefmt time formatting, Error.stack formatting,
usesTime detection, and LogRecord.getMessage with %s arg substitution.
2026-03-13 23:22:10 +01:00
Tiara Rodney
7b9e88ef59
feat(formatter): implement %-style formatting, formatTime, formatError
PercentFormatterStyle._format() now performs %(key)s/d/f substitution
against LogRecord attributes. Formatter.format() sets record.message
via getMessage() and conditionally calls formatTime() for asctime.
formatTime() uses JS Date with strftime-style tokens (%Y,%m,%d,%H,
%M,%S) or ISO8601 fallback. formatError() returns Error.stack.
BASIC_FORMAT updated to use %(levelname)s. Fixed datefmt type in
config.ts.
2026-03-13 23:14:49 +01:00
Tiara Rodney
c0ced4cda2
feat(log-record): add message, name, msg, args fields and getMessage 2026-03-13 23:09:50 +01:00
Tiara Rodney
3dce9422ae
todo(7): in-progress
Implement PercentFormatterStyle._format() with %-style field
substitution, Formatter.formatTime() using JS Date/Intl, and
Formatter.formatError() using Error.stack. Add datetime helpers.
2026-03-13 23:05:33 +01:00
Tiara Rodney
3f424137ac
chore: add roadmap issues 10-13
Add issues for documentation, async support, OCSF formatter, and
browser local storage handler from the README roadmap.
2026-03-13 23:02:46 +01:00
Tiara Rodney
2bdcb17ee6
Merge branch 'feature/6' into dev 2026-03-13 22:56:16 +01:00
Tiara Rodney
fcfbd36153
todo(6): done
Added info(), warning(), error(), and critical() methods to Logger,
each gated by isEnabledFor(). All level methods tested including
effective level filtering.
2026-03-13 22:56:15 +01:00
Tiara Rodney
d95c8d37da
test(logger): add tests for info, warning, error, and critical methods 2026-03-13 22:56:01 +01:00
Tiara Rodney
50df6b4c37
feat(logger): add info, warning, error, and critical methods 2026-03-13 22:55:17 +01:00
Tiara Rodney
7ef841ac43
todo(6): in-progress
Add info(), warning(), error(), and critical() methods to Logger.
2026-03-13 22:53:09 +01:00
Tiara Rodney
72b92af5aa
Merge branch 'bugfix/5' into dev 2026-03-13 22:50:42 +01:00
Tiara Rodney
6e82574723
todo(5): done
Fixed logic bugs across manager, config, logger, handler, and
formatter modules. Manager.getLogger() now correctly creates and
returns loggers with hierarchy setup. Config.basicConfig() reads
the correct option fields and has proper control flow. Logger
isEnabledFor() caches correctly, _log() calls handle(), makeRecord()
uses Object.keys(). Handler has working formatter getter, format()
returns a string, and level setter no longer recurses. Formatter
has a format() method. Added unit tests for all four modules.
2026-03-13 22:50:37 +01:00
Tiara Rodney
3b6b116b00
test: add unit tests for handler, logger, manager, and config
Cover Handler property accessors, format delegation, emit contract,
and close lifecycle. Cover Logger level methods, isEnabledFor caching,
manager property assignment, handler management, debug invocation,
and makeRecord extra key collision. Cover Manager getLogger hierarchy
setup, placeholder fixup, disable level, and loggerClass validation.
Cover basicConfig option handling, force flag, mutual exclusion of
stream/filename/handlers, and formatter assignment.
2026-03-13 22:49:12 +01:00
Tiara Rodney
0b87f5516a
fix(formatter,manager): add Formatter.format(), fix Placeholder access
Add format() method to Formatter class to delegate to the style's
format method. Change Placeholder.loggers to public so Manager can
access it for hierarchy fixup.
2026-03-13 22:42:52 +01:00
Tiara Rodney
9fed1ffe6b
fix(config): correct basicConfig option assignments and control flow
Fix dateformat and style variables reading from wrong option fields
(filemode instead of datefmt/style). Restructure control flow to
match CPython logic: early return when handlers exist and force is
not set, proper mutual exclusion of stream/filename/handlers args.
Remove unreachable code block.
2026-03-13 22:41:29 +01:00
Tiara Rodney
e76d8fb77b
fix(logger): fix isEnabledFor, _log, makeRecord, and manager property
Fix isEnabledFor() to correctly cache and return level check results
instead of always caching false. Fix _log() to call handle() after
creating the LogRecord. Fix makeRecord() to use Object.keys() and
template literal. Add manager getter and fix setter to actually
assign the value.
2026-03-13 22:40:46 +01:00
Tiara Rodney
340b31bc50
fix(handler): add formatter getter, fix format() return, fix level setter
Add missing getter for formatter property. Fix format() to return
the formatted string instead of discarding it. Fix level setter
to assign to _level instead of recursing infinitely.
2026-03-13 22:40:05 +01:00
Tiara Rodney
03e3641e03
fix(manager): correct getLogger and implement hierarchy setup
Fix inverted type check in getLogger() and add missing return
statement. Implement _fixupParents() and _fixupChildren() to
establish parent-child logger relationships based on dot-separated
scope names.
2026-03-13 22:39:35 +01:00
Tiara Rodney
df0126693e
todo(5): in-progress
Fix logic bugs across manager, config, logger, and handler modules.
Manager.getLogger() has inverted type check and missing return.
Config.basicConfig() assigns wrong option fields. Logger.isEnabledFor()
always caches false, _log() never calls handle(). Handler.format()
missing return and formatter getter.
2026-03-13 22:39:02 +01:00
Tiara Rodney
04e9768e89
chore: convert TODO to MIME TODO format and add issues 5-9 2026-03-13 22:38:48 +01:00
Tiara Rodney
25ec89c3b4
fix: correct jest roots and test import path 2026-03-13 22:38:41 +01:00
Tiara Rodney
0cea450c0a
chore: add eslint with typescript-eslint, align package.json scripts 2026-03-13 22:38:36 +01:00
Tiara Rodney
b7c6937219
chore: add tiara-gitflow-spec as vendor submodule 2026-03-13 22:38:27 +01:00
Rodney, Tiara
31f2d6e6f9
chore: move existing tests to sub-directory
introducing sub-directories for each type of tests, so that they're easier to
seperate.
2025-05-01 22:50:34 +02:00
Rodney, Tiara
e6beeec594
chore: update typedoc 2025-05-01 22:50:34 +02:00
Rodney, Tiara
b50586db8f
test(log_level): refactor 2025-05-01 22:50:34 +02:00
Rodney, Tiara
bcb65bfec5
chore: fix package namespacing 2025-05-01 22:50:33 +02:00
Rodney, Tiara
f069a0f2e4
refactor(src): introduce submodules 2025-05-01 22:50:33 +02:00
Rodney, Tiara
ab4ef2baab
doc(README): init rudimentary README 2025-05-01 22:50:33 +02:00
Rodney, Tiara
9f4d9336d2
style(ci): add commands for removing test-reports
Bitbucket Pipelines has some weird default behavior on how artifacts are
archived and JUnit test-reports are parsed on every subsequent run, if the
output was once an artifact. It's confusing to look at via the dashboard, hence
I'm adding an override to remove them beforehand.
2025-05-01 22:50:33 +02:00
Rodney, Tiara
f45e75aa50
to-do(4): in-progress 2025-05-01 22:50:14 +02:00