Skip to content

Commit 86c5ea9

Browse files
authored
Merge 0145f52 into 3137e5c
2 parents 3137e5c + 0145f52 commit 86c5ea9

File tree

9 files changed

+134
-176
lines changed

9 files changed

+134
-176
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19.0.7
1+
19.0.8

connect/Flow.hx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ class Flow extends Base {
493493
for (handler in Env.getLogger().getHandlers()) {
494494
final list = new Collection<String>().push(getFormattedRequest(request, lastRequest, handler.formatter))
495495
.push(getFormattedData(data, lastData, this.data, handler.formatter));
496-
Env.getLogger()._writeToHandler(level, handler.formatter.formatList(list), handler);
496+
Env.getLogger()._writeToHandler(level, handler.formatter.formatList(level,list), handler);
497497
}
498498
}
499499

@@ -505,7 +505,7 @@ class Flow extends Base {
505505
final diff = (lastRequestObj != null && requestObj != null) ? Util.createObjectDiff(requestObj, lastRequestObj) : null;
506506
final requestStr = (diff != null) ? Util.beautifyObject(diff, false) : request;
507507
final requestTitle = (diff != null) ? 'Request (changes):' : 'Request:';
508-
return '$requestTitle${fmt.formatCodeBlock(requestStr, 'json')}';
508+
return '$requestTitle${fmt.formatCodeBlock(Env.getLogger().getLevel(),requestStr, 'json')}';
509509
} else {
510510
return 'Request (id): ${request}';
511511
}
@@ -537,7 +537,7 @@ class Flow extends Base {
537537
Lambda.iter(dataKeys, function(key) {
538538
dataCol.push(new Collection<String>().push(key).push(data.get(key)));
539539
});
540-
return fmt.formatTable(dataCol);
540+
return fmt.formatTable(Env.getLogger().getLevel(),dataCol);
541541
}
542542

543543
/*

connect/api/impl/ApiClientImpl.hx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ class ApiClientImpl extends Base implements IApiClient {
272272
}
273273
Env.getLogger()._writeToHandler(
274274
level,
275-
fmt.formatBlock('$firstMessage${fmt.formatList(requestList)}'),
275+
fmt.formatBlock(level,'$firstMessage${fmt.formatList(level,requestList)}'),
276276
handler);
277277
}
278278
}
@@ -292,7 +292,7 @@ class ApiClientImpl extends Base implements IApiClient {
292292
.push(fixedHeaders.get(key))
293293
);
294294
});
295-
return fmt.formatTable(headersCol);
295+
return fmt.formatTable(Env.getLogger().getLevel(),headersCol);
296296
}
297297

298298

@@ -322,7 +322,7 @@ class ApiClientImpl extends Base implements IApiClient {
322322
final compact = Env.getLogger().getLevel() != Logger.LEVEL_DEBUG;
323323
if (Util.isJson(data)) {
324324
final prefix = compact ? '$title (compact):' : '$title:';
325-
final block = fmt.formatCodeBlock(Util.beautify(data, compact), 'json');
325+
final block = fmt.formatCodeBlock(Env.getLogger().getLevel(),Util.beautify(data, compact), 'json');
326326
return '$prefix $block';
327327
} else {
328328
final fixedBody = compact

connect/logger/ILoggerFormatter.hx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
/*
22
This file is part of the Ingram Micro CloudBlue Connect SDK.
33
Copyright (c) 2019 Ingram Micro. All Rights Reserved.
4-
*/
4+
*/
5+
56
package connect.logger;
67

78
import connect.util.Collection;
89

9-
1010
/**
1111
* Represents a log formatter.The `Logger` uses an instance of a class that implements
1212
* this interface (`MarkdownLoggerFormatter` by default) to write log messages.
1313
*/
1414
interface ILoggerFormatter {
15-
public function formatSection(level: Int, text: String): String;
16-
public function formatBlock(text: String): String;
17-
public function formatCodeBlock(text: String, language: String): String;
18-
public function formatList(list: Collection<String>): String;
19-
public function formatTable(table: Collection<Collection<String>>): String;
20-
public function formatLine(text:String):String;
15+
public function formatSection(level:Int, text:String):String;
16+
public function formatBlock(level:Int, text:String):String;
17+
public function formatCodeBlock(level:Int, text:String, language:String):String;
18+
public function formatList(level:Int, list:Collection<String>):String;
19+
public function formatTable(level:Int, table:Collection<Collection<String>>):String;
20+
public function formatLine(level:Int, text:String):String;
2121
}

0 commit comments

Comments
 (0)