Skip to content

Commit b7c5f7a

Browse files
committed
Remove unused steno features and document modification policy
Removed ~270 lines of unused code to simplify maintenance: Removed files: - lib/steno/version.rb - VERSION constant unused (no longer a gem) - lib/steno/json_prettifier.rb - CLI prettifier tool, ~130 lines - lib/steno/core_ext.rb - Monkey patches unused by CCNG - spec/unit/lib/steno/unit/json_prettifier_spec.rb - Tests for removed feature - spec/unit/lib/steno/unit/core_ext_spec.rb - Tests for removed feature - Removed require for version.rb from steno.rb Kept (even if unused): - TaggedLogger - Part of public Logger#tag() API - Logger#log_exception() - Useful utility method - Context::FiberLocal - Valid alternative, minimal code Updated README.md: - Documented all removed features in modifications section - Added "Making Future Modifications" section with guidelines - Added reminder to document changes in README when modifying steno Tests: 78 examples passing (was 86, removed 8 test examples for deleted features)
1 parent 488070f commit b7c5f7a

File tree

7 files changed

+29
-271
lines changed

7 files changed

+29
-271
lines changed

lib/steno/README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,13 @@ This is a **modified version** of the original Steno library, adapted for CCNG's
3434

3535
## Modifications Made After Integration
3636

37-
The following changes were made to adapt steno for CCNG:
37+
The following changes were made to adapt steno for CCNG. **When making future modifications to this integrated library, please document them in this section.**
3838

3939
### 1. JSON Library Migration (Yajl → Oj)
4040
**Rationale**: Consolidate on single JSON library used throughout CCNG
4141

4242
**Changes**:
4343
- `lib/steno/codec/json.rb`: `Yajl::Encoder.encode``Oj.dump`
44-
- `lib/steno/json_prettifier.rb`: `Yajl::Parser.parse``Oj.load`
4544
- `lib/steno/codec/codec_rfc3339.rb`: Added `require 'oj'`
4645
- `lib/steno/sink/counter.rb`: Changed to Oj, fixed to use string keys
4746
- Test files updated to use `Oj.load`
@@ -79,6 +78,34 @@ Syslog.close if Syslog.opened?
7978
- Windows conditionals from config.rb, syslog.rb, test files
8079
- `WINDOWS` constant from sink/base.rb
8180

81+
### 6. Unused Features Removal
82+
**Rationale**: Remove dead code not used by CCNG
83+
84+
**Removed**:
85+
- `lib/steno/version.rb` - Version constant no longer needed (not a gem)
86+
- `lib/steno/json_prettifier.rb` - CLI tool for prettifying logs, unused (~110 lines)
87+
- `lib/steno/core_ext.rb` - Monkey patches for `.logger` on Module/Class/Object, CCNG uses `Steno.logger()` instead (~50 lines)
88+
- `spec/unit/lib/steno/unit/json_prettifier_spec.rb` - Tests for removed feature
89+
- `spec/unit/lib/steno/unit/core_ext_spec.rb` - Tests for removed feature
90+
- Removed `require 'steno/version'` from steno.rb
91+
92+
**What's kept** (even if unused):
93+
- `TaggedLogger` - Part of public API via `Logger#tag()`
94+
- `Logger#log_exception()` - Useful utility method
95+
- `Context::FiberLocal` - Valid alternative context type, minimal code
96+
97+
---
98+
99+
## Making Future Modifications
100+
101+
If you modify this integrated steno library:
102+
103+
1. **Document changes** in the "Modifications Made After Integration" section above
104+
2. **Include rationale** for why the change was made
105+
3. **List affected files** and what changed
106+
4. **Run tests** to ensure nothing breaks: `bundle exec rspec spec/unit/lib/steno/`
107+
5. **Update this README** in the same commit as your changes
108+
82109
## Original Steno Commit History (102 commits)
83110

84111
The complete commit history from the steno repository:

lib/steno/core_ext.rb

Lines changed: 0 additions & 11 deletions
This file was deleted.

lib/steno/json_prettifier.rb

Lines changed: 0 additions & 130 deletions
This file was deleted.

lib/steno/steno.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
require 'steno/tagged_logger'
88
require 'steno/record'
99
require 'steno/sink'
10-
require 'steno/version'
1110

1211
module Steno
1312
class << self

lib/steno/version.rb

Lines changed: 0 additions & 3 deletions
This file was deleted.

spec/unit/lib/steno/unit/core_ext_spec.rb

Lines changed: 0 additions & 42 deletions
This file was deleted.

spec/unit/lib/steno/unit/json_prettifier_spec.rb

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)