Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
cbb95e3e
Commit
cbb95e3e
authored
Aug 22, 2013
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update logging to check level is enabled
parent
0fa0082b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
YamlProcessor.java
...n/java/org/springframework/boot/config/YamlProcessor.java
+17
-7
No files found.
spring-boot/src/main/java/org/springframework/boot/config/YamlProcessor.java
View file @
cbb95e3e
...
...
@@ -129,7 +129,9 @@ public class YamlProcessor {
private
boolean
process
(
MatchCallback
callback
,
Yaml
yaml
,
Resource
resource
)
{
int
count
=
0
;
try
{
this
.
logger
.
info
(
"Loading from YAML: "
+
resource
);
if
(
this
.
logger
.
isDebugEnabled
())
{
this
.
logger
.
debug
(
"Loading from YAML: "
+
resource
);
}
for
(
Object
object
:
yaml
.
loadAll
(
resource
.
getInputStream
()))
{
if
(
object
!=
null
&&
process
(
asMap
(
object
),
callback
))
{
count
++;
...
...
@@ -138,8 +140,10 @@ public class YamlProcessor {
}
}
}
this
.
logger
.
info
(
"Loaded "
+
count
+
" document"
+
(
count
>
1
?
"s"
:
""
)
+
" from YAML resource: "
+
resource
);
if
(
this
.
logger
.
isDebugEnabled
())
{
this
.
logger
.
debug
(
"Loaded "
+
count
+
" document"
+
(
count
>
1
?
"s"
:
""
)
+
" from YAML resource: "
+
resource
);
}
}
catch
(
IOException
ex
)
{
handleProcessError
(
resource
,
ex
);
...
...
@@ -167,7 +171,9 @@ public class YamlProcessor {
Properties
properties
=
new
Properties
();
assignProperties
(
properties
,
map
,
null
);
if
(
this
.
documentMatchers
.
isEmpty
())
{
this
.
logger
.
debug
(
"Merging document (no matchers set)"
+
map
);
if
(
this
.
logger
.
isDebugEnabled
())
{
this
.
logger
.
debug
(
"Merging document (no matchers set)"
+
map
);
}
callback
.
process
(
properties
,
map
);
}
else
{
...
...
@@ -177,8 +183,10 @@ public class YamlProcessor {
MatchStatus
match
=
matcher
.
matches
(
properties
);
result
=
MatchStatus
.
getMostSpecific
(
match
,
result
);
if
(
match
==
MatchStatus
.
FOUND
)
{
this
.
logger
.
debug
(
"Matched document with document matcher: "
+
properties
);
if
(
this
.
logger
.
isDebugEnabled
())
{
this
.
logger
.
debug
(
"Matched document with document matcher: "
+
properties
);
}
callback
.
process
(
properties
,
map
);
valueFound
=
true
;
// No need to check for more matches
...
...
@@ -186,7 +194,9 @@ public class YamlProcessor {
}
}
if
(
result
==
MatchStatus
.
ABSTAIN
&&
this
.
matchDefault
)
{
this
.
logger
.
debug
(
"Matched document with default matcher: "
+
map
);
if
(
this
.
logger
.
isDebugEnabled
())
{
this
.
logger
.
debug
(
"Matched document with default matcher: "
+
map
);
}
callback
.
process
(
properties
,
map
);
}
else
if
(!
valueFound
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment