Elvas Tower: New contributing guideines for code - logging - Elvas Tower

Jump to content

Posting Rules

All new threads will be started by members of the Open Rails team, Staff, and/or Admins. Existing threads started in other forums may get moved here when it makes sense to do so.

Once a thread is started any member may post replies to it.
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

New contributing guideines for code - logging Rate Topic: -----

#1 User is online   James Ross 

  • Open Rails Developer
  • Group: Posts: Elite Member
  • Posts: 5,544
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 21 October 2025 - 10:32 AM

In an effort to write down more guidelines and helpful information for people writing code for Open Rails, we have added a new document to the repository: Open Rails Code Guidelines.

This document is linked from within the General requirements section of our main Contributing to Open Rails document.

The first area covered by this document is logging - with guidelines on how to choose the right severity, log message, and method to call.

Please let me know if there are other areas of coding that you'd like to see documented guidelines for or if there is anything that can be improved with the new logging guidelines.

#2 User is offline   C44-9W 

  • Fireman
  • Group: Posts: Active Member
  • Posts: 135
  • Joined: 18-March 23
  • Gender:Male
  • Simulator:Openrails
  • Country:

Posted 24 October 2025 - 04:03 PM

I think a similar guide for error messages in message boxes would be useful.

In particular, should catalogue lookups be on the message itself or on a message token?

With a token, we can make minor changes to the message without breaking all existing translations. On the other hand, it might be better to show the English message than a stale translation.

PS: This was prompted by the following message (from a PR review): "Failed to access the content repository (check Internet connection); automatic download not available. Error: {0}"

#3 User is online   James Ross 

  • Open Rails Developer
  • Group: Posts: Elite Member
  • Posts: 5,544
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 09 January 2026 - 04:04 PM

View PostC44-9W, on 24 October 2025 - 04:03 PM, said:

I think a similar guide for error messages in message boxes would be useful.

In particular, should catalogue lookups be on the message itself or on a message token?

With a token, we can make minor changes to the message without breaking all existing translations. On the other hand, it might be better to show the English message than a stale translation.

PS: This was prompted by the following message (from a PR review): "Failed to access the content repository (check Internet connection); automatic download not available. Error: {0}"

We have just added some guidelines on translations, which states "Use English (United States) for all translations" (I admit that could be clearer what it is talking about).

The catalogue lookup value is used for untranslated or partially translated languages, so it must be valid for displaying to the user. This also avoids the extra work and chance of messing up when using tokens (I have worked on projects using tokens).

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users