Skip to content

Commit

Permalink
added loggers
Browse files Browse the repository at this point in the history
  • Loading branch information
fehguy committed Feb 1, 2015
1 parent a7c9c4a commit b628bb2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions modules/swagger-models/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ public void add(SecurityDefinition def) {
if(def.scopes != null)
for(String key: def.scopes.keySet()) {
String value = def.scopes.get(key);
System.out.println(key + " adding scope " + value);
this.addScope(key, value);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
package com.wordnik.swagger.models.properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.*;

public class PropertyBuilder {
static Logger LOGGER = LoggerFactory.getLogger(PropertyBuilder.class);

public static Property build(String type, String format, Map<String, Object> args) {
if(args == null) {
args = new HashMap<String, Object>();
Expand Down Expand Up @@ -92,7 +97,7 @@ public static Property build(String type, String format, Map<String, Object> arg
// fallbacks
if("integer".equals(type) && format == null) {
// fall back to Integer if type is integer and format is missing
System.out.println("no format specified for integer type, falling back to int32");
LOGGER.debug("no format specified for integer type, falling back to int32");
property = new IntegerProperty()
.minimum(minimum)
.maximum(maximum)
Expand All @@ -101,11 +106,11 @@ public static Property build(String type, String format, Map<String, Object> arg
}
if("object".equals(type) && format == null) {
// fall back to Map if type is object and format is missing
System.out.println("no format specified for object type, falling back to object");
LOGGER.debug("no format specified for object type, falling back to object");
property = new ObjectProperty();
}
if(property == null)
System.out.println("no property for " + type + ", " + format);
LOGGER.debug("no property for " + type + ", " + format);
return property;
}
}

0 comments on commit b628bb2

Please sign in to comment.