Commit graph

66 commits

Author SHA1 Message Date
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
Rodney, Tiara
07b1228ac0
to-do(4): open 2025-05-01 22:49:51 +02:00
Rodney, Tiara
72248008b9
to-do(3): in-progress 2025-05-01 22:27:00 +02:00
Rodney, Tiara
f38f62f53e
todo(3): open 2025-05-01 22:26:30 +02:00
Rodney, Tiara
fcf45f22a3
todo(1): in-progress 2025-05-01 17:49:34 +02:00
Rodney, Tiara
15e4a5f0e1
doc(TODO): add issue #2 2025-05-01 17:49:34 +02:00
Rodney, Tiara
b159b44f7b
doc(TODO): init
my poor-man's issue tracker, as I don't want to worry about the overhead of
using a third-party service for this at the moment.
2025-05-01 17:49:34 +02:00
Rodney, Tiara
be34f5c670
chore: add override for jest
jest has a deprecated dependency, this override fixes that
2025-05-01 17:47:01 +02:00
Rodney, Tiara
08f9c830b6
chore: regenerate npm Lockfile
Yikes... This is an issue I need to fix soon. I'm using a local pull-through
mirror/proxy for npmjs.org, that's why it needs to be incorporated in the
workflow somehow... It already is... Kinda...
2025-04-25 19:41:51 +02:00
Rodney, Tiara
b7aaeb0e8c
chore: init CI 2025-04-25 19:35:41 +02:00
Rodney, Tiara
ec74d648ce
feat(make): introduce build flags
CI for skipping tests and being able to execute them separately in a CI service
run and WATCH to not require a seperate npm scripts target.
2025-04-25 19:32:14 +02:00
Rodney, Tiara
1d90596e4a
fix: rename targets 2025-04-25 19:20:01 +02:00
Rodney, Tiara
c4a98da88e
chore: make tests work 2025-04-25 19:19:40 +02:00
Rodney, Tiara
e4e21d4016
chore: rename docs source directory 2025-04-25 18:49:41 +02:00
Rodney, Tiara
5baeb0f441
chore: remove redundant sources
Well this started a little messy and I didn't really stick to atomicity. This
was the first script I've written, which was later transferred to the index.
It's the same code just with less structure and some funcitionality missing...
2025-04-25 18:47:49 +02:00
Rodney, Tiara
9f5e88d034
chore: remove redundant .npmignore
Handling the package structure myself through scripts/npm-pack.ts
2025-04-25 18:45:24 +02:00
Rodney, Tiara
281803dff8
chore: remove redundant script 2025-04-25 18:44:19 +02:00