Skip to content

Commit

Permalink
Adding toString method, this is helpful for logs
Browse files Browse the repository at this point in the history
  • Loading branch information
rainboyan committed Apr 18, 2023
1 parent 7047b3f commit dd8c608
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -535,4 +535,10 @@ trait Controller implements ResponseRenderer, ResponseRedirector, RequestForward
webRequest.setAttribute(GrailsApplicationAttributes.ERRORS, errors, 0)
}

@Generated
@Override
String toString() {
getControllerClass()?.fullName
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -35,4 +35,9 @@ class GrailsControllerUrlMappingInfo implements UrlMappingInfo {
this.info = info
}

@Override
String toString() {
controllerClass.fullName + '#' + (info.actionName ?: controllerClass.defaultAction)
}

}

0 comments on commit dd8c608

Please sign in to comment.