You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make configuration a little less dependant on Sentry being set up (#104)
* move sentry config options into their own struct
make sentry integration more optional
* move sentry config outside of other config object
* missed removing sentryconfig from config constructor
* add attach function to add custom log destinations
* add trace sample rate to sentry config
* add readme info for traces sample rate
Copy file name to clipboardExpand all lines: README.md
+35-7Lines changed: 35 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,28 +50,52 @@ _Firebase Crashlytics is no longer a supported destination for crash reporting_
50
50
51
51
SteamcLog has a number of configuration options
52
52
53
-
### logLevel: LogLevelPreset
53
+
####logLevel: LogLevelPreset
54
54
Destination logging levels; it is recommended to use the defaults set by Steamclog instead of initializing these manually. In special cases where more data is desired, update this property. See technical documentation for more details on the available presets.
55
55
56
-
### requireRedacted: Bool
56
+
####requireRedacted: Bool
57
57
Default value is `false`.
58
58
Require that all logged objects conform to Redacted or are all redacted by default.
59
59
60
-
### autoRotateConfig: AutoRotateConfig
60
+
####autoRotateConfig: AutoRotateConfig
61
61
By default, logs will rotate every 10 minutes, and store 10 archived log files.
62
62
`AutoRotateConfig` allows customization for the auto-rotating behaviour.
63
63
64
64
`AutoRotateConfig` has the following fields:
65
65
**fileRotationTime: TimeInterval**: The number of seconds before the log file is rotated and archived.
66
66
67
-
### sentryFilter: SentryFilter
67
+
Additionally, SteamcLog comes with support to log to Sentry:
68
+
69
+
### Sentry configuration options
70
+
71
+
#### key: String
72
+
Your Sentry key
73
+
74
+
#### attachStackTrace: Bool
75
+
Default value is `true`.
76
+
Toggles Sentry automatically attaching stack traces to error reports.
77
+
78
+
#### autoSessionTracking: Bool
79
+
Default value is `true`.
80
+
Toggle's Sentry's auto session tracking. More info [here](https://docs.sentry.io/platforms/cocoa/?platform=swift#release-health).
81
+
82
+
#### debug: Bool
83
+
Default value is `false`.
84
+
Sets Sentry to debug mode. More info [here](https://docs.sentry.io/error-reporting/configuration/?platform=swift#debug)
85
+
86
+
#### tracesSampleRate: NSNumber
87
+
Default value is 0.0.
88
+
Sets the percentage of the tracing data that is collected by Sentry. Values must be between 0 and 1, and values larger than 1 will be set to 1.
89
+
Note that setting this to anything greater than 0 can cause projects to blow past their usage quotas by generating far more events than normal.
90
+
91
+
#### filter: SentryFilter
68
92
By default, all error objects will be sent to Sentry when submitted via the `error` call.
69
-
`SentryFilter` allows you to change this behaviour at the SteamcLog Config-level.
93
+
This allows you to change this behaviour at the SteamcLog Config-level, by passing in a function that filters errors from being logged.
70
94
71
95
```swift
72
-
Config(
96
+
SentryConfig(
73
97
// other fields
74
-
sentryFilter: { error in
98
+
filter: { error in
75
99
iflet error = error as? CustomError {
76
100
returntrue// CustomError errors will no longer be submitted to Sentry
In addition to the Sentry log destination that comes packaged with SteamcLog, you can create your own log destination and attach it to your SteamcLog instance using `attach`.
155
+
128
156
## Using SteamcLog with Netable
129
157
130
158
If you're also using [Netable](https://github.com/steamclock/netable), you can pipe your logs directly from Netable into SteamcLog.
0 commit comments