Skip to content

Commit

Permalink
RUMM-2173 Add doc and changelog for logger threshold option + ObjC co…
Browse files Browse the repository at this point in the history
…mpat
  • Loading branch information
xgouchet committed May 25, 2022
1 parent d8194a8 commit 630d8ff
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### Changes

* [FEATURE] Allow filtering outgoing logs with a status threshold. See [#867][]

# 1.11.0-rc1 / 18-05-2022

### Changes
Expand Down
5 changes: 5 additions & 0 deletions Sources/DatadogObjc/Logger+objc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ public class DDLoggerBuilder: NSObject {
_ = sdkBuilder.printLogsToConsole(enabled)
}

@objc
public func set(datadogReportingThreshold: LogLevel) {
_ = sdkBuilder.set(datadogReportingThreshold: datadogReportingThreshold)
}

@objc
public func build() -> DDLogger {
return DDLogger(sdkLogger: sdkBuilder.build())
Expand Down
2 changes: 2 additions & 0 deletions docs/log_collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,15 @@ DDDatadog.verbosityLevel = DDSDKVerbosityLevelDebug;
let logger = Logger.builder
.sendNetworkInfo(true)
.printLogsToConsole(true, usingFormat: .shortWith(prefix: "[iOS App] "))
.set(datadogReportingThreshold: .info)
.build()
```
{{% /tab %}}
{{% tab "Objective-C" %}}
```objective-c
DDLoggerBuilder *builder = [DDLogger builder];
[builder sendNetworkInfo:YES];
[builder setWithDatadogReportingThreshold:.info]
[builder printLogsToConsole:YES];

DDLogger *logger = [builder build];
Expand Down
4 changes: 2 additions & 2 deletions tools/lint/run-linter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ if [[ -z "${XCODE_VERSION_ACTUAL}" ]]; then
swiftlint lint --config ./tools/lint/tests.swiftlint.yml --reporter "emoji" --strict
else
# when run by Xcode in Build Phase
swiftlint lint --config ./tools/lint/sources.swiftlint.yml --reporter "xcode"
swiftlint lint --config ./tools/lint/tests.swiftlint.yml --reporter "xcode"
swiftlint lint --config ./tools/lint/sources.swiftlint.yml --reporter "xcode" --fix
swiftlint lint --config ./tools/lint/tests.swiftlint.yml --reporter "xcode" --fix
fi

0 comments on commit 630d8ff

Please sign in to comment.