Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escaping: Escape characters +-&|!(){}[]^"~*?:\ with \, e.g. \+
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
How to Use block version of log commands

How to Use block version of log commands in GW

Posted one year ago
Votes Newest

Answers 2

When writing to the log file at anything lower than the Info level, it is considered best practice to check the level before passing a string expression that includes any string manipulation. This is because the string manipulation itself has some performance overhead that need not be consumed if you are not going to log at that level of detail.
So it is common practice to check the log level before executing the log method (see example below). But Gosu provides an overloaded log method signature that takes a block parameter instead of an actual string parameter. This version of the method obviates the need to explicitly check the log level because the method does the same check before evaluating the block. This gives the perf advantage of not executing any string manipulations unless you are at the right level AND you do not have to have a specific check for the level.

Always use the block method signature for any log commands at Debug, Trace, or Info levels. Do not put in specific checks for those levels.

abstract class AbstractISOLocationFinder<T extends AbstractISOLocationSearchResult> implements ISOLocationFinder<T> {


protected function processForNonEmptyHighAndLowAddress(result: List<T>, criteria: ISOLocationSearchCriteria, _dbConnection: Connection): List<T> {
  if (_LOGGER.isDebugEnabled()) {
    _LOGGER.debug(DisplayKey.get("logging.entering", "AbstractISOLocationFinder", "processForNonEmptyHighAndLowAddress"))

Correct usage of Logger statements
_LOGGER.debug(\->DisplayKey.get ("logging.entering", "AbstractISOLocationFinder", "processForNonEmptyHighAndLowAddress")) 
Posted one year ago

Some wiki entry

Posted one year ago
Profile picture

Your answer

2 Answers
one year ago
one year ago