Skip to content

Commit

Permalink
trimMessage: only one space to avoid triple-lining, also TimeTag meta
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 2, 2022
1 parent 81ec416 commit f4f0829
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Expand Up @@ -408,8 +408,11 @@ public static void registerTags() {
// @attribute <TimeTag.to_zone[<zone>]>
// @returns TimeTag
// @description
// Returns a copy of the time zone, converted to the specified time zone.
// Returns a copy of the TimeTag, converted to the specified time zone.
// The hour (and when relevant: day/month/year) of this TimeTag will automatically be converted from the value for the original TimeTag's timezone to the new timezone.
// For some zones, the minute might also change.
// Zone input can be like 'UTC-5' or like 'America/New_York'
// You can find a list of named zones here: <@link url https://en.wikipedia.org/wiki/List_of_tz_database_time_zones> using the "TZ database name"
// -->
tagProcessor.registerStaticTag(TimeTag.class, ElementTag.class, "to_zone", (attribute, object, zone) -> {
try {
Expand All @@ -425,7 +428,7 @@ public static void registerTags() {
// @attribute <TimeTag.to_local>
// @returns TimeTag
// @description
// Returns a copy of the time zone, converted to the local time zone.
// Returns a copy of the TimeTag, converted to the local time zone.
// -->
tagProcessor.registerStaticTag(TimeTag.class, "to_local", (attribute, object) -> {
return new TimeTag(object.instant.withZoneSameInstant(ZoneId.systemDefault()));
Expand All @@ -435,7 +438,7 @@ public static void registerTags() {
// @attribute <TimeTag.to_utc>
// @returns TimeTag
// @description
// Returns a copy of the time zone, converted to Universal Coordinated Time.
// Returns a copy of the TimeTag, converted to Universal Coordinated Time.
// -->
tagProcessor.registerStaticTag(TimeTag.class, "to_utc", (attribute, object) -> {
return new TimeTag(object.instant.withZoneSameInstant(ZoneOffset.UTC));
Expand Down
Expand Up @@ -41,7 +41,7 @@ public static String trimMessage(String message) {
}
int trimSize = CoreConfiguration.debugTrimLength;
if (message.length() > trimSize) {
message = message.substring(0, (trimSize / 2) - 10) + " ... * snip! * ... " + message.substring(message.length() - ((trimSize / 2) - 10));
message = message.substring(0, (trimSize / 2) - 10) + "... *snip!*..." + message.substring(message.length() - ((trimSize / 2) - 10));
}
return message;
}
Expand Down

0 comments on commit f4f0829

Please sign in to comment.