From fc04f95b45507346e61508c9445917aeaedd2c75 Mon Sep 17 00:00:00 2001 From: Ahmed Ibrahim Date: Mon, 22 Apr 2024 10:55:27 +0200 Subject: [PATCH] removed noisy logs --- CHANGELOG.md | 4 ++ pom.xml | 2 +- .../social/networking/ws/methods/v2/Lib.java | 46 +++++++++---------- 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e45fdf..4674b77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [v3.0.1-SNAPSHOT] - 2023-04-22 + +- Feature 27286: removed noisy logs + ## [v3.0.0-SNAPSHOT] - 2023-12-06 - Feature #26193, new impl for get users by role in a VRE diff --git a/pom.xml b/pom.xml index f977c9d..d3911bb 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ org.gcube.portal social-networking-library-ws war - 3.0.0-SNAPSHOT + 3.0.1-SNAPSHOT social-networking-library-ws Rest interface for the social networking library. diff --git a/src/main/java/org/gcube/portal/social/networking/ws/methods/v2/Lib.java b/src/main/java/org/gcube/portal/social/networking/ws/methods/v2/Lib.java index 899456e..da9beb8 100644 --- a/src/main/java/org/gcube/portal/social/networking/ws/methods/v2/Lib.java +++ b/src/main/java/org/gcube/portal/social/networking/ws/methods/v2/Lib.java @@ -50,7 +50,7 @@ public class Lib { ResponseBean responseBean = new ResponseBean(); Status status = Status.OK; try { - logger.info("Writing comment with commentid " + comment.getKey()); + logger.debug("Writing comment with commentid " + comment.getKey()); boolean result = CassandraConnection.getInstance().getDatabookStore().addComment(comment); responseBean.setResult(result); responseBean.setMessage(""); @@ -72,7 +72,7 @@ public class Lib { ResponseBean responseBean = new ResponseBean(); Status status = Status.OK; try{ - logger.info("Getting comment with commentid " + commentid); + logger.debug("Getting comment with commentid " + commentid); Comment result = CassandraConnection.getInstance().getDatabookStore().readCommentById(commentid); responseBean.setResult(result); responseBean.setMessage(""); @@ -103,7 +103,7 @@ public class Lib { List comments = null; try{ - logger.info("Retrieving comments for postid " + postid); + logger.debug("Retrieving comments for postid " + postid); comments = CassandraConnection.getInstance().getDatabookStore().getAllCommentByPost(postid); responseBean.setResult(comments); responseBean.setSuccess(true); @@ -133,7 +133,7 @@ public class Lib { List comments = null; try{ - logger.info("Retrieving comments for user id " + username); + logger.debug("Retrieving comments for user id " + username); comments = CassandraConnection.getInstance().getDatabookStore().getRecentCommentsByUserAndDate(username, timeInMillis); responseBean.setResult(comments); responseBean.setMessage(""); @@ -160,7 +160,7 @@ public class Lib { ResponseBean responseBean = new ResponseBean(); Status status = Status.OK; try{ - logger.info("Writing comment with commentid " + comment.getKey()); + logger.debug("Writing comment with commentid " + comment.getKey()); boolean result = CassandraConnection.getInstance().getDatabookStore().editComment(comment); responseBean.setResult(result); responseBean.setMessage(""); @@ -187,7 +187,7 @@ public class Lib { ResponseBean responseBean = new ResponseBean(); Status status = Status.OK; try{ - logger.info("deleting comment with commentid " + commentid); + logger.debug("deleting comment with commentid " + commentid); boolean result = CassandraConnection.getInstance().getDatabookStore().deleteComment(commentid, postid); responseBean.setResult(result); responseBean.setMessage(""); @@ -218,7 +218,7 @@ public class Lib { ResponseBean responseBean = new ResponseBean(); Status status = Status.OK; try{ - logger.info("Saving hashtags " ); + logger.debug("Saving hashtags " ); boolean result = CassandraConnection.getInstance().getDatabookStore().saveHashTags(feedid,vreid,hashtags); responseBean.setResult(result); responseBean.setMessage(""); @@ -249,7 +249,7 @@ public class Lib { ResponseBean responseBean = new ResponseBean(); Status status = Status.OK; try{ - logger.info("deleting hashtags " ); + logger.debug("deleting hashtags " ); boolean result = CassandraConnection.getInstance().getDatabookStore().deleteHashTags(feedid,vreid,hashtags); responseBean.setResult(result); responseBean.setMessage(""); @@ -280,7 +280,7 @@ public class Lib { ResponseBean responseBean = new ResponseBean(); Status status = Status.OK; try{ - logger.info("Saving hashtags comments " ); + logger.debug("Saving hashtags comments " ); boolean result = CassandraConnection.getInstance().getDatabookStore().saveHashTagsComment(commentid,vreid,hashtags); responseBean.setResult(result); responseBean.setMessage(""); @@ -310,7 +310,7 @@ public class Lib { ResponseBean responseBean = new ResponseBean(); Status status = Status.OK; try{ - logger.info("deleting hashtags " ); + logger.debug("deleting hashtags " ); boolean result = CassandraConnection.getInstance().getDatabookStore().deleteHashTagsComment(commentid,vreid,hashtags); responseBean.setResult(result); responseBean.setMessage(""); @@ -338,7 +338,7 @@ public class Lib { Map hashtags = null; try{ - logger.info("getting vre hashtags occurrences " + vreid); + logger.debug("getting vre hashtags occurrences " + vreid); hashtags = CassandraConnection.getInstance().getDatabookStore().getVREHashtagsWithOccurrence(vreid); responseBean.setResult(hashtags); responseBean.setMessage(""); @@ -369,7 +369,7 @@ public class Lib { Map hashtags = null; try{ - logger.info("getting vre hashtags occurrences " + vreid); + logger.debug("getting vre hashtags occurrences " + vreid); hashtags = CassandraConnection.getInstance().getDatabookStore().getVREHashtagsWithOccurrenceFilteredByTime(vreid, timestamp); responseBean.setResult(hashtags); responseBean.setMessage(""); @@ -399,7 +399,7 @@ public class Lib { List posts = null; try{ - logger.info("getting vre hashtags occurrences " + vreid); + logger.debug("getting vre hashtags occurrences " + vreid); posts = CassandraConnection.getInstance().getDatabookStore().getVREPostsByHashtag(vreid, hashtag); responseBean.setResult(posts); responseBean.setMessage(""); @@ -428,7 +428,7 @@ public class Lib { String inv = null; try{ - logger.info("Retrieving invite for vre " + vreid); + logger.debug("Retrieving invite for vre " + vreid); inv = CassandraConnection.getInstance().getDatabookStore().isExistingInvite(vreid, email); responseBean.setResult(inv); responseBean.setMessage(""); @@ -481,7 +481,7 @@ public class Lib { Invite inv = null; try{ - logger.info("Retrieving invite for id " + inviteid); + logger.debug("Retrieving invite for id " + inviteid); inv = CassandraConnection.getInstance().getDatabookStore().readInvite(inviteid); responseBean.setResult(inv); responseBean.setMessage(""); @@ -570,7 +570,7 @@ public class Lib { ResponseBean responseBean = new ResponseBean(); Status status = Status.OK; try{ - logger.info("Writing like with likeid " + like.getKey()); + logger.debug("Writing like with likeid " + like.getKey()); boolean result = CassandraConnection.getInstance().getDatabookStore().like(like); responseBean.setResult(result); responseBean.setMessage(""); @@ -599,7 +599,7 @@ public class Lib { ResponseBean responseBean = new ResponseBean(); Status status = Status.OK; try{ - logger.info("Writing unlike with likeid " + likeid); + logger.debug("Writing unlike with likeid " + likeid); boolean result = CassandraConnection.getInstance().getDatabookStore().unlike(userid,likeid,feedid); responseBean.setResult(result); responseBean.setMessage(""); @@ -627,7 +627,7 @@ public class Lib { List likes = null; try{ - logger.info("Retrieving likes for user id " + userid); + logger.debug("Retrieving likes for user id " + userid); likes = CassandraConnection.getInstance().getDatabookStore().getAllLikedPostIdsByUser(userid); responseBean.setResult(likes); responseBean.setMessage(""); @@ -655,7 +655,7 @@ public class Lib { List likes = null; try{ - logger.info("Retrieving likes for post id " + postid); + logger.debug("Retrieving likes for post id " + postid); likes = CassandraConnection.getInstance().getDatabookStore().getAllLikesByPost(postid); responseBean.setResult(likes); responseBean.setMessage(""); @@ -928,9 +928,9 @@ public class Lib { ) throws ValidationException{ ResponseBean responseBean = new ResponseBean(); for(NotificationType notificationType: enabledChannels.keySet()){ - logger.info("Type: " + notificationType.toString()); + logger.debug("Type: " + notificationType.toString()); for(NotificationChannelType channelType: enabledChannels.get(notificationType)){ - logger.info(channelType.toString()); + logger.debug(channelType.toString()); } } Status status = Status.OK; @@ -1017,8 +1017,8 @@ public class Lib { responseBean.setMessage(""); responseBean.setSuccess(result); }catch(Exception e){ - logger.info("Unable to write attachment.", e); - logger.info(e.getMessage()); + logger.error("Unable to write attachment.", e); + logger.error(e.getMessage()); responseBean.setMessage(e.getMessage()); responseBean.setSuccess(false); status = Status.INTERNAL_SERVER_ERROR;