11package com .contentstack .sdk ;
22
33import com .contentstack .sdk .utility .CSAppConstants ;
4- import com .contentstack .sdk .utility .CSAppUtils ;
54import com .contentstack .sdk .utility .CSController ;
65import com .contentstack .sdk .utility .ContentstackUtil ;
6+ import org .apache .logging .log4j .LogManager ;
7+ import org .apache .logging .log4j .Logger ;
78import org .json .JSONArray ;
89import org .json .JSONException ;
910import org .json .JSONObject ;
10-
1111import java .util .*;
1212
1313/**
3737
3838public class Entry {
3939
40- private static final String TAG = " Entry" ;
40+ private final Logger logger = LogManager . getLogger ( Entry . class . getName ()) ;
4141 private String contentTypeName = null ;
4242 private LinkedHashMap <String , Object > localHeader = null ;
4343 protected LinkedHashMap <String , Object > formHeader = null ;
@@ -330,7 +330,7 @@ public Object get(String key){
330330 return null ;
331331 }
332332 }catch (Exception e ) {
333- Stack . log ( TAG , e .getLocalizedMessage ());
333+ logger . debug ( e .getLocalizedMessage ());
334334 return null ;
335335 }
336336 }
@@ -568,7 +568,7 @@ public Calendar getDate(String key){
568568 String value = getString (key );
569569 return ContentstackUtil .parseDate (value , null );
570570 } catch (Exception e ) {
571- Stack . log ( TAG , e .getLocalizedMessage ());
571+ logger . debug ( e .getLocalizedMessage ());
572572 }
573573 return null ;
574574 }
@@ -590,7 +590,7 @@ public Calendar getCreateAt(){
590590 String value = getString ("created_at" );
591591 return ContentstackUtil .parseDate (value , null );
592592 } catch (Exception e ) {
593- Stack . log ( TAG , e .getLocalizedMessage ());
593+ logger . debug ( e .getLocalizedMessage ());
594594 }
595595 return null ;
596596 }
@@ -626,7 +626,7 @@ public Calendar getUpdateAt(){
626626 String value = getString ("updated_at" );
627627 return ContentstackUtil .parseDate (value , null );
628628 } catch (Exception e ) {
629- Stack . log ( TAG , e .getLocalizedMessage ());
629+ logger . debug ( e .getLocalizedMessage ());
630630 }
631631 return null ;
632632 }
@@ -662,7 +662,7 @@ public Calendar getDeleteAt(){
662662 String value = getString ("deleted_at" );
663663 return ContentstackUtil .parseDate (value , null );
664664 } catch (Exception e ) {
665- Stack . log ( TAG , e .getLocalizedMessage ());
665+ logger . debug ( e .getLocalizedMessage ());
666666 }
667667 return null ;
668668 }
@@ -826,7 +826,7 @@ public ArrayList<Entry> getAllEntries(String refKey, String refContentType) {
826826 entryInstance = contentTypeInstance .stackInstance .contentType (refContentType ).entry ();
827827 } catch (Exception e ) {
828828 entryInstance = new Entry (refContentType );
829- Stack . log ("BuiltObject" , "---------getAllEntries" + e .toString ());
829+ logger . debug ("BuiltObject" , "---------getAllEntries" + e .toString ());
830830 }
831831 entryInstance .setUid (model .entryUid );
832832 entryInstance .ownerEmailId = model .ownerEmailId ;
@@ -846,7 +846,7 @@ public ArrayList<Entry> getAllEntries(String refKey, String refContentType) {
846846 }
847847 }
848848 } catch (Exception e ) {
849- Stack . log ( TAG , "-----------------get|" + e );
849+ logger . debug ( "-----------------get|" + e );
850850 return null ;
851851 }
852852
@@ -885,7 +885,7 @@ public Entry except(String[] fieldUid){
885885 }
886886 }
887887 }catch (Exception e ) {
888- Stack . log ( TAG , "--except-catch|" + e );
888+ logger . debug ( "--except-catch|" + e );
889889 }
890890 return this ;
891891 }
@@ -916,7 +916,7 @@ public Entry includeReference(String referenceField) {
916916 otherPostJSON .put ("include[]" , referenceArray );
917917 }
918918 } catch (Exception e ) {
919- Stack . log ( TAG , "--include Reference-catch|" + e );
919+ logger . debug ( "--include Reference-catch|" + e );
920920 }
921921 return this ;
922922 }
@@ -950,7 +950,7 @@ public Entry includeReference(String[] referenceFields) {
950950 otherPostJSON .put ("include[]" , referenceArray );
951951 }
952952 } catch (Exception e ) {
953- Stack . log ( TAG , "--include Reference-catch|" + e );
953+ logger . debug ( "--include Reference-catch|" + e );
954954 }
955955 return this ;
956956 }
@@ -986,7 +986,7 @@ public Entry only(String[] fieldUid) {
986986 }
987987 }
988988 }catch (Exception e ) {
989- Stack . log ( TAG , "--include Reference-catch|" + e );
989+ logger . debug ( "--include Reference-catch|" + e );
990990 }
991991 return this ;
992992 }
@@ -1030,7 +1030,7 @@ public Entry onlyWithReferenceUid(ArrayList<String> fieldUid, String referenceFi
10301030 includeReference (referenceFieldUid );
10311031 }
10321032 }catch (Exception e ) {
1033- Stack . log ( TAG , "--onlyWithReferenceUid-catch|" + e );
1033+ logger . debug ( "--onlyWithReferenceUid-catch|" + e );
10341034 }
10351035 return this ;
10361036 }
@@ -1072,7 +1072,7 @@ public Entry exceptWithReferenceUid(ArrayList<String> fieldUid, String reference
10721072 includeReference (referenceFieldUid );
10731073 }
10741074 }catch (Exception e ) {
1075- Stack . log ( TAG , "--exceptWithReferenceUid-catch|" + e );
1075+ logger . debug ( "--exceptWithReferenceUid-catch|" + e );
10761076 }
10771077 return this ;
10781078 }
@@ -1169,7 +1169,7 @@ private LinkedHashMap<String, Object> getUrlParams(JSONObject jsonMain) {
11691169 Object value = queryJSON .opt (key );
11701170 hashMap .put (key , value );
11711171 } catch (Exception e ) {
1172- Stack . log ( TAG , "----------------setQueryJson" +e .toString ());
1172+ logger . debug ( "----------------setQueryJson" +e .toString ());
11731173 }
11741174 }
11751175 return hashMap ;
0 commit comments