Saturday, March 21, 2020

Aspects to log enter and exit method

https://github.com/vernetto/logaspect

The idea is:

use @EnableAspectJAutoProxy in a @Configuration

create an annotation EntryExitLogger to mark the method(s) you want to be logged for entry/exit

have a @Component annotated with @Aspect and inside it you specify the aspects:

@Around("@annotation(EntryExitLogger)")
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable{
}


That's all.

Detailed post on the topic https://medium.com/@wkrzywiec/moving-into-next-level-in-user-log-events-with-spring-aop-3b4435892f16

Doc of AspectJ here https://docs.spring.io/spring/docs/2.0.x/reference/aop.html

Good Aspectj cookbock here https://blog.espenberntsen.net/2010/03/20/aspectj-cheat-sheet/

Wednesday, February 19, 2020

github and line separators

https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_formatting_and_whitespace " You can tell Git to convert CRLF to LF on commit but not the other way around by setting core.autocrlf to input:

$ git config --global core.autocrlf input "



https://www.jetbrains.com/help/idea/configuring-line-endings-and-line-separators.html this one also helps



Per-repository settings

Optionally, you can configure a .gitattributes file to manage how Git reads line endings in a specific repository. When you commit this file to a repository, it overrides the core.autocrlf setting for all repository contributors. This ensures consistent behavior for all users, regardless of their Git settings and environment.


in Intellij there is an "Inconsistent line separators inspection", to check if the files have "line terminator" different from the default setup for the project
"This inspection detects files with line separators different from the project default. E.g. you set the line separator to "\n" in the Settings|Code Style|Line separator, and the file you are editing uses '\r\n' as a line separator"





Thursday, February 13, 2020

Spring Integration

https://youtu.be/oQ2CBtYrSYo?list=PLO0KWyajXMh6HbVTnf7YqwbEeZU6kuKJa nice tutorial here

code is available at https://github.com/vernetto/sidemo.git