Conversation
brgix
commented
Aug 4, 2025
- syncing with latest v0.3.3 release of Python version (pyOSlg).
| echo $(pwd) | ||
| echo $(ls) | ||
| docker pull nrel/openstudio:3.6.1 | ||
| docker run --name test --rm -d -t -v $(pwd):/work -w /work nrel/openstudio:3.6.1 |
There was a problem hiding this comment.
No reason to keep pulling in the OpenStudio docker image.
|
|
||
| if len.is_a?(Numeric) | ||
| txt = txt[0...len.to_i] + " ..." if txt.length > len.to_i | ||
| end |
There was a problem hiding this comment.
Revisiting this proposed change, having tested it with other gems (i.e. OSlg as a dependency). OSlg shall no longer have a built-in limit on log message lengths. Good option to offer, but not one to bake in.
All OSlg log functions (e.g. zero, mismatch) call on log, which itself calls trim:
- ensures valid log message strings
- trims final log message length if requested by user
- if trimming not requested by user, leaves log message as is
Each OSlg log function now has an additional len parameter, which is nilled by default (and therefore ignored). Users are free to set len to e.g. "160" chars.
| expect(l1 + l2 + l3 + l4).to eq(231) | ||
| expect(array.to_s.size).to eq(l1 + l2 + l3 + l4) | ||
| expect(cls2.mismatch("x", "String", Array, array)).to be_nil | ||
| expect(cls2.mismatch("x", "String", Array, array, cls2::FATAL, nil, 160)).to be_nil |
There was a problem hiding this comment.
To request a shortened logged message, users must activate the last log function parameter, len (here, "160").
Tested, works, hopefully done. Certainly not keen on revisiting this in the future (unless absolutely necessary, e.g. bug, future Ruby change). So definitely trying to nail this down ASAP.
Running larger test suites (e.g. parent gems, calling upon OSlg). Will only merge and re-release OSlg once all other test suites pass.
|
|
||
| module OSlg | ||
| VERSION = "0.3.3".freeze # OSlg version | ||
| VERSION = "0.4.0".freeze # OSlg version |
There was a problem hiding this comment.
Although branch is "v033", bumping up version to v.0.4.0 given API changes.