|
1 | | -# Steno Integration History |
| 1 | +# Steno Logging Library |
2 | 2 |
|
3 | | -This directory contains the steno logging library, integrated from https://github.com/cloudfoundry/steno |
| 3 | +This directory contains the Steno logging library, integrated into Cloud Controller NG from the original standalone repository. |
| 4 | + |
| 5 | +**Original Repository**: https://github.com/cloudfoundry/steno |
| 6 | +**Integration Date**: February 25, 2026 |
| 7 | +**Integration Method**: Git subtree (squashed) |
| 8 | +**Final Upstream Commit**: 5b08405f9 "Remove unused rack-test dependency and add explicit stdlib requires" |
| 9 | + |
| 10 | +## About This Integration |
| 11 | + |
| 12 | +Steno was originally maintained as a separate gem used by Cloud Controller NG. It has been integrated directly into CCNG because: |
| 13 | + |
| 14 | +1. **Low maintenance overhead**: Steno is stable and rarely changes |
| 15 | +2. **Compliance requirements**: CCNG requires annual dependency updates; integrating removes this overhead for a stable library |
| 16 | +3. **Single ownership**: Both projects are maintained by the Cloud Foundry Foundation |
| 17 | + |
| 18 | +This is a **modified version** of the original Steno library, adapted for CCNG's specific needs. |
| 19 | + |
| 20 | +## What Was Integrated |
| 21 | + |
| 22 | +- All steno library code (~1,106 lines) |
| 23 | +- Custom RFC3339 codec (previously in `lib/steno_custom_codec_temp/`) |
| 24 | +- LICENSE file (Apache 2.0 - for attribution) |
| 25 | +- NOTICE file (Apache 2.0 copyright notices) |
| 26 | +- Test suite (in `spec/unit/lib/steno/`) |
| 27 | + |
| 28 | +## What Was Excluded |
| 29 | + |
| 30 | +- Gem infrastructure (gemspec, Gemfile, Rakefile) |
| 31 | +- CI configuration (.github/) |
| 32 | +- Documentation (README, CHANGELOG, RELEASING) |
| 33 | +- Development tools (bin/steno-prettify, .rubocop*, etc.) |
| 34 | + |
| 35 | +## Modifications Made After Integration |
| 36 | + |
| 37 | +The following changes were made to adapt steno for CCNG: |
| 38 | + |
| 39 | +### 1. JSON Library Migration (Yajl → Oj) |
| 40 | +**Rationale**: Consolidate on single JSON library used throughout CCNG |
| 41 | + |
| 42 | +**Changes**: |
| 43 | +- `lib/steno/codec/json.rb`: `Yajl::Encoder.encode` → `Oj.dump` |
| 44 | +- `lib/steno/json_prettifier.rb`: `Yajl::Parser.parse` → `Oj.load` |
| 45 | +- `lib/steno/codec/codec_rfc3339.rb`: Added `require 'oj'` |
| 46 | +- `lib/steno/sink/counter.rb`: Changed to Oj, fixed to use string keys |
| 47 | +- Test files updated to use `Oj.load` |
| 48 | + |
| 49 | +### 2. Syslog Reopening Fix |
| 50 | +**Issue**: "syslog already open" error in tests after removal of syslog-logger wrapper |
| 51 | + |
| 52 | +**Fix**: Modified `lib/steno/sink/syslog.rb`: |
| 53 | +```ruby |
| 54 | +Syslog.close if Syslog.opened? |
| 55 | +``` |
| 56 | + |
| 57 | +### 3. RuboCop Compliance |
| 58 | +**Variable naming**: |
| 59 | +- `ex` → `exception` (logger.rb, tagged_logger.rb) |
| 60 | +- `io` → `io_obj` (sink/io.rb - avoid shadowing IO class) |
| 61 | + |
| 62 | +**Code style**: |
| 63 | +- `sprintf` → string interpolation |
| 64 | +- Added rubocop disable comments where needed |
| 65 | +- Added empty class documentation |
| 66 | +- Added `require 'active_support/core_ext/module/delegation'` where needed |
| 67 | + |
| 68 | +### 4. Test Structure Updates |
| 69 | +- Moved tests from `lib/steno/spec/` to `spec/unit/lib/steno/` (CCNG convention) |
| 70 | +- Removed global spec_helper requires, added explicit requires per test |
| 71 | +- Wrapped test describes in parent `RSpec.describe` blocks |
| 72 | + |
| 73 | +### 5. Windows Support Removal |
| 74 | +**Rationale**: CCNG only runs on Linux |
| 75 | + |
| 76 | +**Removed**: |
| 77 | +- `lib/steno/sink/eventlog.rb` (Windows Event Log sink) |
| 78 | +- `spec/unit/lib/steno/unit/sink/eventlog_spec.rb` |
| 79 | +- Windows conditionals from config.rb, syslog.rb, test files |
| 80 | +- `WINDOWS` constant from sink/base.rb |
4 | 81 |
|
5 | 82 | ## Original Steno Commit History (102 commits) |
6 | 83 |
|
@@ -111,66 +188,10 @@ ff2f6e6 Update README to include Bug filing info per Deepika |
111 | 188 | a1a602a Initial commit of steno |
112 | 189 | ``` |
113 | 190 |
|
114 | | -## Integration Details |
115 | | - |
116 | | -- **Source Repository**: https://github.com/cloudfoundry/steno (house-keeping branch) |
117 | | -- **Integration Method**: Git subtree with --squash |
118 | | -- **Integration Date**: February 25, 2026 |
119 | | -- **Final Steno Commit**: 5b08405f9 "Remove unused rack-test dependency and add explicit stdlib requires" |
120 | | - |
121 | | -## What Was Integrated |
122 | | - |
123 | | -- All steno library code (~1,106 lines) |
124 | | -- Custom RFC3339 codec (previously in lib/steno_custom_codec_temp/) |
125 | | -- LICENSE file (Apache 2.0 - copied from original repository for attribution) |
126 | | -- NOTICE file (Apache 2.0 copyright notices - copied from original repository) |
127 | | -- Test suite (moved to spec/unit/lib/steno/) |
128 | | - |
129 | | -## What Was Excluded |
130 | | - |
131 | | -- Gem infrastructure (gemspec, Gemfile, Rakefile) |
132 | | -- CI configuration (.github/) |
133 | | -- Documentation (README, CHANGELOG, RELEASING) |
134 | | -- Development tools (bin/steno-prettify, .rubocop*, etc.) |
135 | | - |
136 | | -## Modifications Made After Integration |
137 | | - |
138 | | -The following changes were made to adapt steno for CCNG's needs: |
| 191 | +## License |
139 | 192 |
|
140 | | -### 1. JSON Library Migration (Yajl → Oj) |
141 | | -- **Rationale**: CCNG uses Oj throughout; consolidate on single JSON library |
142 | | -- **Files changed**: |
143 | | - - `lib/steno/codec/json.rb`: Changed `Yajl::Encoder.encode` → `Oj.dump` |
144 | | - - `lib/steno/json_prettifier.rb`: Changed `Yajl::Parser.parse` → `Oj.load`, exception handling |
145 | | - - `lib/steno/codec/codec_rfc3339.rb`: Added `require 'oj'` |
146 | | - - `lib/steno/sink/counter.rb`: Changed encoder to Oj |
147 | | - - Test files updated to use `Oj.load` instead of `Yajl::Parser.parse` |
148 | | - |
149 | | -### 2. Syslog Reopening Fix |
150 | | -- **Issue**: "syslog already open" error in tests due to removal of syslog-logger wrapper |
151 | | -- **Fix**: Modified `lib/steno/sink/syslog.rb` to close syslog before reopening |
152 | | -- **Added**: `Syslog.close if Syslog.opened?` before `Syslog.open()` |
| 193 | +Steno is licensed under the Apache License 2.0. See LICENSE and NOTICE files in this directory for full copyright and license information. |
153 | 194 |
|
154 | | -### 3. RuboCop Compliance |
155 | | -- **Variable naming**: |
156 | | - - `ex` → `exception` (in logger.rb, tagged_logger.rb) |
157 | | - - `io` → `io_obj` (in sink/io.rb to avoid shadowing IO class) |
158 | | -- **Code style**: |
159 | | - - `sprintf` → string interpolation in json_prettifier.rb |
160 | | - - Added rubocop disable comments where needed (e.g., `Lint/BinaryOperatorWithIdenticalOperands`) |
161 | | - - Added empty class documentation comments |
162 | | -- **Dependencies**: Added `require 'active_support/core_ext/module/delegation'` where needed |
| 195 | +**Copyright (c) 2015 - Present CloudFoundry.org Foundation, Inc. All Rights Reserved.** |
163 | 196 |
|
164 | | -### 4. Test Structure Updates |
165 | | -- **Moved**: Tests from lib/steno/spec/ to spec/unit/lib/steno/ (CCNG convention) |
166 | | -- **Isolation**: Removed global spec_helper requires, added explicit requires per test file |
167 | | -- **Structure**: Wrapped test describes in parent `RSpec.describe` blocks for proper namespacing |
168 | | - |
169 | | -### 5. Windows Support Removal |
170 | | -- **Rationale**: CCNG only runs on Linux; removing unused platform-specific code |
171 | | -- **Removed**: |
172 | | - - `lib/steno/sink/eventlog.rb` (Windows Event Log sink) |
173 | | - - `spec/unit/lib/steno/unit/sink/eventlog_spec.rb` (Windows tests) |
174 | | - - Windows conditionals from config.rb, syslog.rb, and test files |
175 | | - - `WINDOWS` constant from sink/base.rb |
176 | | -- **Simplified**: Syslog sink no longer conditionally defined |
| 197 | +This project contains software that is Copyright (c) 2012-2015 Pivotal Software, Inc. |
0 commit comments