Skip to content

Syncing with pyOSlg#16

Merged
brgix merged 5 commits intodevfrom
v033
Aug 13, 2025
Merged

Syncing with pyOSlg#16
brgix merged 5 commits intodevfrom
v033

Conversation

@brgix
Copy link
Member

@brgix brgix commented Aug 4, 2025

  • syncing with latest v0.3.3 release of Python version (pyOSlg).

@brgix brgix self-assigned this Aug 4, 2025
@brgix brgix added the enhancement New feature or request label Aug 4, 2025
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
Copy link
Member Author

@brgix brgix Aug 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member Author

@brgix brgix Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member Author

@brgix brgix Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although branch is "v033", bumping up version to v.0.4.0 given API changes.

@brgix brgix merged commit 90122d9 into dev Aug 13, 2025
4 checks passed
@brgix brgix deleted the v033 branch August 13, 2025 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant