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
-[Error and Fatal Specific Signatures](#error-and-fatal-specific-signatures)
25
+
+[Exporting Logs](#exporting-logs)
26
+
-[Variable Redaction](#variable-redaction)
27
+
28
+
_[Table of contents generated with markdown-toc](http://ecotrust-canada.github.io/markdown-toc/)_
29
+
30
+
## Development
31
+
32
+
### Deploying new versions
33
+
34
+
These steps are for developers looking to create a new release of the Steamclog library; if this does not pertain to you, please skip down to the **Installation** section.
35
+
36
+
Currently we are hosting the library on [Jitpack](https://jitpack.io/), to deploy a new version of the library:
37
+
38
+
1. Push all changes to master
39
+
2. From within the GitHub repo, navigate to the Code panel; on the right side should be a **Releases** section
40
+
3. Click on **Releases** (which should take you [here](https://github.com/steamclock/steamclog-android/releases))
41
+
4. Make note of the latest release version name (ie. v1.1)
42
+
5. Click the **Draft a new release** button on the right
43
+
6. Set the **Tag Version**; it's best use the last release version as a guide (ie. set as v1.2)
44
+
7. Set **Release Title** to be "Steamclog <Version>"
45
+
8. Description is optional, could set changelog here if desired
46
+
9. Click the **Publish Release** button at the bottom
47
+
10. Verify on the [Jitpack page for the Steamclog project](https://jitpack.io/#steamclock/steamclog-android) that the new version is available
48
+
11. Update projects using Steamclog with the new version
49
+
50
+
## Usage
8
51
9
-
Current supported MinSDK: 21
10
-
The library is not yet hosted publicly, so current installation steps involve building and copying over the AAR file from this repo.
52
+
### Installation
11
53
12
-
Steps to install Steamclog:
13
-
1. Create an `aars` folder in your project's app module (if it does not already exist)
14
-
2. Place the `steamclog-release.aar` file into the `aars` folder.
15
-
3. Add the following to your app module's build.gradle file:
16
-
```
17
-
implementation files('aars/steamclog-debug.aar')
18
-
```
19
-
4. Sync your project grdle files
20
-
5. `Steamclog`singleton should now be available
54
+
Steamclog is currently hosted on Jitpack; to include it in your project:
21
55
22
-
## Initialization
56
+
1. Add this in your **root** build.gradle at the end of repositories:
57
+
```
58
+
allprojects {
59
+
repositories {
60
+
...
61
+
maven { url 'https://jitpack.io' }
62
+
}
63
+
}
64
+
```
65
+
66
+
2. Add the dependency in your app module's build.gradle:
Most recent version can be found [here](https://github.com/steamclock/steamclog-android/releases)
73
+
74
+
3. Sync your project gradle files
75
+
76
+
4.`Steamclog` singleton should now be available
77
+
78
+
### Initialization
23
79
24
80
Steamclog can also be accessed via the `clog` typealias.
25
81
@@ -30,7 +86,7 @@ Out of the box, Steamclog will have support for
30
86
* Firebase Crashlytics (setup required)
31
87
* Firebase Analytics (setup required)
32
88
33
-
### Enabling External File Logging
89
+
####Enabling External File Logging
34
90
35
91
The `Steamclog.initWith` method can be used to enable external logging; this method only needs to be called once, and can be done in your Application object's `onCreate` method.
36
92
@@ -49,14 +105,14 @@ You will need to create a new application on the Sentry dashboard which requires
49
105
50
106
Once your main project has Sentry enabled no further work should be required for Steamclog to report to it.
51
107
52
-
### Enabling Firebase Crashlytics
108
+
####Enabling Firebase Crashlytics
53
109
54
110
To setup Firebase Crashyltics in your project, see https://firebase.google.com/docs/crashlytics/get-started?platform=android
55
111
56
112
Once your main project has Crashlytics enabled (ie. includes the required `google-services.json` file etc...) no further work should be required for Steamclog to report to it.
57
113
58
114
59
-
### Enabling Firebase Analytics
115
+
####Enabling Firebase Analytics
60
116
61
117
To setup Firebase Analytics in your project, see https://firebase.google.com/docs/analytics/get-started?platform=android
62
118
@@ -73,11 +129,11 @@ Both logging and analytics can be initialized at the same time:
There are four log level presets available, each of which has different logging outputs.
83
139
@@ -86,16 +142,16 @@ There are four log level presets available, each of which has different logging
86
142
|`firehose`| verbose | verbose | none |
87
143
|`develop`| none | debug | none |
88
144
|`release`| none | none | warn |
89
-
| `releaseAdvanced` | verbose | none | warn |
145
+
|`releaseAdvanced`| verbose | none |info|
90
146
91
147
In most cases, you'll be able to get by using `firehose` or `develop` on debug builds, and `release` or `releaseAdvanced` for production builds.
92
148
Note that if you're using `releaseAdvanced` you must build in a way for the client to email you the disk logs.
93
149
94
-
### requireRedacted: Bool
150
+
####requireRedacted: Bool
95
151
Default value is `false`.
96
152
Require that all logged objects conform to Redacted or are all redacted by default.
97
153
98
-
## Usage
154
+
### Common methods
99
155
100
156
From there, you can use `clog` anywhere in your application with the following levels. Note that availability of these logs will depend on your Configuration's `logLevel`.
101
157
@@ -106,26 +162,26 @@ From there, you can use `clog` anywhere in your application with the following l
106
162
`clog.error` - Something has gone wrong, report to a remote service (like Crashlytics)
107
163
`clog.fatal` - Something has gone wrong and we cannot recover, so force the app to close.
108
164
109
-
### Basic Signatures
165
+
####Basic Signatures
110
166
111
167
Each of these functions has the following 2 available signatures:
112
168
`clog.<level>(_ message: String)`
113
169
`clog.<level>(_ message: String, object: Any)`
114
170
115
171
If `requireRedacted` is set to `true`, then the Any object *must* implement the Redactable interface, else all properties will be shown as `<REDACTED>`.
116
172
117
-
### Error and Fatal Specific Signatures
173
+
####Error and Fatal Specific Signatures
118
174
Error and Fatal levels have 2 more signatures that allows a given Throwable to be associated with the log.
If no `Throwable` object is given for an error or fatal log, Steamclog will create a generic `NonFatalException` instance that will be used to generate crash reports on Crashlytics.
123
179
124
-
## Exporting Logs
180
+
###Exporting Logs
125
181
126
182
If logging to a file has been enabled, then files, you can get the log file contents using `clog.getLogFileContents(): String?`
127
183
128
-
### Variable Redaction
184
+
####Variable Redaction
129
185
130
186
`Redacted` is a protocol that can be conformed to by a struct or class for marking particular fields as safe for logging. By default, a class implementing the `Redactable` will have all fields marked as redacted, and you can define logging-safe fields using the `safeProperties` field.
0 commit comments