{"id":19509873,"url":"https://github.com/steamclock/steamclog-android","last_synced_at":"2026-02-11T05:32:15.458Z","repository":{"id":42445555,"uuid":"260543904","full_name":"steamclock/steamclog-android","owner":"steamclock","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-29T22:26:16.000Z","size":437,"stargazers_count":2,"open_issues_count":24,"forks_count":0,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-05-07T07:42:11.342Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/steamclock.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-05-01T19:40:53.000Z","updated_at":"2025-01-29T22:25:44.000Z","dependencies_parsed_at":"2023-12-12T20:24:22.752Z","dependency_job_id":"b69d91ce-dac7-4d1c-b1d1-931fd96fc4aa","html_url":"https://github.com/steamclock/steamclog-android","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/steamclock/steamclog-android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamclock%2Fsteamclog-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamclock%2Fsteamclog-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamclock%2Fsteamclog-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamclock%2Fsteamclog-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steamclock","download_url":"https://codeload.github.com/steamclock/steamclog-android/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steamclock%2Fsteamclog-android/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29327326,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T03:52:29.695Z","status":"ssl_error","status_checked_at":"2026-02-11T03:52:23.094Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T23:13:46.625Z","updated_at":"2026-02-11T05:32:15.444Z","avatar_url":"https://github.com/steamclock.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SteamcLog Android\n\n[Technical Documentation](https://coda.io/d/SteamcLog-Public-Documentation_dYDBWMQYscM/SteamcLog-Technical-Documentation_suPjU)\n\n[iOS Repo](https://github.com/steamclock/steamclog)\n\nAn open source library that consolidates/formalizes the logging setup and usage across all of Steamclock's projects.\n\n## Table of Contents\n- [Usage](#usage)\n  * [Installation](#installation)\n  * [Initialization (Required)](#initialization--required-)\n  * [Initialization (Optional)](#initialization--optional-)\n  * [Enabling Sentry Reporting](#enabling-sentry-reporting)\n    + [If application already has Sentry setup:](#if-application-already-has-sentry-setup-)\n    + [If project does not have Sentry setup:](#if-project-does-not-have-sentry-setup-)\n    + [Filtering out some Throwables from being logged to Sentry](#filtering-out-some-throwables-from-being-logged-to-sentry)\n  * [Common logging methods](#common-logging-methods)\n    + [Basic Signatures](#basic-signatures)\n    + [Error and Fatal Specific Signatures](#error-and-fatal-specific-signatures)\n  * [Interfaces](#interfaces)\n    + [Redactable](#redactable)\n    + [FilterOut](#filterout)\n  * [Exporting Logs](#exporting-logs)\n    + [Variable Redaction](#variable-redaction)\n  * [Firebase](#firebase)\n    + [Enabling Firebase Crashlytics (No longer supported)](#enabling-firebase-crashlytics--no-longer-supported-)\n    + [Enabling Firebase Analytics (No longer supported)](#enabling-firebase-analytics--no-longer-supported-)\n- [Development](#development)\n  * [Deploying new versions](#deploying-new-versions)\n\n\u003csmall\u003e\u003ci\u003e\u003ca href='http://ecotrust-canada.github.io/markdown-toc/'\u003eTable of contents generated with markdown-toc\u003c/a\u003e\u003c/i\u003e\u003c/small\u003e\n\n## Usage\n\n### Installation\n\nSteamclog is currently hosted on Jitpack; to include it in your project:\n\n1. Add this in your **root** build.gradle at the end of repositories:\n``` \n\tallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n``` \n\n2. Add the dependency in your app module's build.gradle:\n```\n\tdependencies {\n\t    implementation 'com.github.steamclock:steamclog-android:\u003cVERSION\u003e'\n\t}\n```\nMost recent version can be found [here](https://github.com/steamclock/steamclog-android/releases)\n\n3. Add the following exclusion in your app module's build.gradle. As of Sentry 3.1.0 the Sentry library includes a Timber integration that will conflict with Steamclog's Timber integration, causing duplicate errors to be logged. To avoid this, we need to exclude the Sentry Timber integration from the Sentry library. See https://docs.sentry.io/platforms/android/integrations/timber/ for details.\n```\n    configurations.configureEach {\n      exclude group: \"io.sentry\", module: \"sentry-android-timber\"\n    }\n```\n\n4Sync your project gradle files\n\n5`Steamclog` singleton should now be available\n\n### Initialization (Required)\n\nTo initialize Steamclog call `clog.initWith` in your app's custom Application class's `onCreate` method.\nThis function takes the following required properties:\n* `isDebug` (Boolean): If application is considered to be a debug build; in most cases this is your application's `BuildConfig.DEBUG` flag. Determines the default Log Level Presets Steamclog selects for the build.\n* `fileWritePath` (File): Location where the file destination will write to. This is most easily done by passing along the application's `externalCacheDir` or `cacheDir` file paths.\n\nExample:\n```\nclass App: Application() {\n...\n   override fun onCreate() {\n      clog.initWith(BuildConfig.DEBUG, externalCacheDir)\n   }      \n```\n\nOnce initialized, this will give out of the box support for printing to the console and writing to a file. Further steps are required to enable remote logging to Sentry.\n\n### Initialization (Optional)\n\nThe Config object has the following optional properties which may be overridden if desired. These may be set initially when calling `initWith` or updated at run time.\n\n`Config`:\n* `keepLogsForDays` (Int, default 3): Determines how long generated log files are kept for.\n* `autoRotateConfig` (AutoRotateConfig, see below): Configuration for auto-rotating file behaviour.\n* `requireRedacted` (Boolean, default false): Indicates if any extra objects being logged must implement the redacted interface. For apps with very sensitive data models, it is suggested to set this to true.\n* `filtering` (FilteredOut, default nothing filtered): Allows application to implement the FilteredOut interface.\n* `logLevel`: (LogLevelPreset, default based on `isDebug` setting): 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.\n\n`AutoRotateConfig`:\n* `fileRotationSeconds` (Long, default 600): The number of seconds before a log file is rotated; default of 600 == 10 mins.\n\nExample:\n```\nclass App: Application() {\n...\n   override fun onCreate() {\n        clog.initWith(Config(\n            BuildConfig.DEBUG,\n            externalCacheDir,\n            keepLogsForDays = 3,\n            autoRotateConfig = AutoRotateConfig(fileRotationSeconds = 600L),\n            requireRedacted = false,\n            filtering = { throwable -\u003e\n                when (throwable) {\n                    is BlockedException1 -\u003e true\n                    is BlockedException2 -\u003e true\n                    else -\u003e false\n                }\n            }\n        ))\n   }      \n```\n\n### Enabling Sentry Reporting\n\n#### If application already has Sentry setup:\n* Remove the sentry library import from your app `build.gradle`; steamclog will import this for you now.\n\nThat should be it! Steamclog should now be responsible for calling all Sentry commands using the Sentry dsn values already setup on the project.\n\n#### If project does not have Sentry setup:\nIf the application is **not** setup to report to Sentry yet, do the following:\n1. Create a new application on the Sentry dashboard; see the `Step 1: Create the project` section on https://docs.sentry.io/product/sentry-basics/guides/integrate-frontend/create-new-project/ for full details, making sure to select Android as the platform. You do not need to worry about setting up alerts at this time. Once completed, you should be given a Sentry DSN string; hold onto this for now.\n2. In your application's `AndroidManifest` file add the following line to the application object. And that should be it! Steamclog will use this dsn value when reporting to Sentry.\n    ```\n    \u003cmeta-data android:name=\"io.sentry.dsn\" android:value=\"\u003cYour Sentry DSN String from step 1\" /\u003e\n    ```\n\n3. (Optional, if your project makes use of Proguard or R8) In your app's `build.gradle` file, add the following plugin. See https://github.com/getsentry/sentry-android-gradle-plugin for the most current release version. This plugin is responsible for uploading the mappings for the build to Sentry so that we get nice, readable stack traces.\n    ```\n    'io.sentry.android.gradle' \n    ```\n   And to avoid Sentry from using the default Timber intergration, add the following also in the app's `build.gradle` file:\n    ```\n    configurations.configureEach {\n      exclude group: \"io.sentry\", module: \"sentry-android-timber\"\n    }\n    ```\n   (See https://docs.sentry.io/platforms/android/configuration/integrations/timber/ for full details)\n   \n\n#### Filtering out some Throwables from being logged to Sentry\nSee the `FilterOut` interface and `filtering` config property.\n\n\n### Common logging methods\n\nSee the [API Docs](https://coda.io/d/SteamcLog-Public-Documentation_dYDBWMQYscM/API-Docs_suZP0#_lu7W8) for full details\n\n* `clog.verbose` - Log all of the things! Probably only output to the console by developers, never to devices.\n* `clog.debug` - Info that is interesting to developers, any information that may be helpful when debugging. Should be stored to system logs for debug builds but never stored in production.\n* `clog.info` - Routine app operations, used to document changes in state within the application. Minimum level of log stored in device logs in production.\n* `clog.warn` - Developer concerns or incorrect state etc. Something’s definitely gone wrong, but there’s a path to recover\n* `clog.error` - Something has gone wrong, report to a remote service (like Sentry)\n* `clog.fatal` - Something has gone wrong and we cannot recover, so force the app to close.\n\n#### Basic Signatures\n\nEach of these functions has the following 2 available signatures:\n* `clog.\u003clevel\u003e(_ message: String)`\n* `clog.\u003clevel\u003e(_ message: String, object: Any)`\n\nIf `requireRedacted` is set to `true`, then the Any object *must* implement the Redactable interface, else all properties will be shown as `\u003cREDACTED\u003e`.\n\n#### Error and Fatal Specific Signatures\nError and Fatal levels have a special signature that allows a given Throwable to be associated with the log.\n* `clog.\u003clevel\u003e(_ message: String, throwable: Throwable,  object: Any)`\n\nPlease note, an error will only be logged if the Throwable is _not_ in the blocked via the `FilterOut` interface implementation.\n\n### Interfaces\n\n#### Redactable\nClasses that wish to be flagged as Redactable can be implementated as follows:\n```kotlin\nimport com.steamclock.steamclog.*\n\ndata class User(val name: String, val email: String, val bankingSecret: String) : Redactable {\n    override val safeProperties = HashSet\u003cString\u003e(setOf(\"name\"))\n}\n```\nIn this case, when a `User` object is logged by Steamclog like:\n```\nclog.info(\"Testing Redactable Class\", User(\"shayla\", \"me@email.com\", \"123456\"))\n```\nThe logged output would appear as:\n```\nTesting Redactable Class : User(bankingSecret=\u003credacted\u003e, email=\u003credacted\u003e, name=shayla)\n```\nThe `name` value may be logged, but the `email` and `bankingSecret` values will be redacted.\n\n#### FilterOut\nA `FilterOut` implementation may look like:\n```\nvar filtering = FilterOut { throwable -\u003e\n    when (throwable) {\n        is BlockedException1 -\u003e true\n        is BlockedException2 -\u003e true\n        else -\u003e false\n    }\n```\nor be implementated on a given class:\n```\nclass App : Application(), FilterOut {\n    ...\n\n    override fun shouldBlock(throwable: Throwable): Boolean {\n        return when (throwable) {\n            is BlockedException1 -\u003e true\n            is BlockedException2 -\u003e true\n            else -\u003e false\n        }\n    }\n}\n```\n\n### Exporting Disk Logs\n\nIf logging to a file has been enabled, then files, you can get the log file contents using `clog.getLogFileContents(): String?`\n\n### Firebase\n\n#### Enabling Firebase Crashlytics (No longer supported)\n\n_Firebase Crashlytics is no longer a supported destination for crash reporting_\n\n#### Enabling Firebase Analytics (No longer supported)\n\n_Firebase Analytics is no longer a supported for tracking analytics; tracking must be handled manually by the calling project_\n\n## Development\n\n### Deploying new versions\n\nThese 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.\n\nCurrently we are hosting the library on [Jitpack](https://jitpack.io/), to deploy a new version of the library:\n\n1. Push all changes to master\n2. From within the GitHub repo, navigate to the Code panel; on the right side should be a **Releases** section\n3. Click on **Releases** (which should take you [here](https://github.com/steamclock/steamclog-android/releases))\n4. Make note of the latest release version name (ie. v1.1)\n5. Click the **Draft a new release** button on the right\n6. Set the **Tag Version**; it's best use the last release version as a guide (ie. set as v1.2)\n7. Set **Release Title** to be \"Steamclog \u003cVersion\u003e\"\n8. Description is optional, could set changelog here if desired\n9. Click the **Publish Release** button at the bottom\n10. Verify on the [Jitpack page for the Steamclog project](https://jitpack.io/#steamclock/steamclog-android) that the new version is available\n11. Update projects using Steamclog with the new version\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteamclock%2Fsteamclog-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteamclock%2Fsteamclog-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteamclock%2Fsteamclog-android/lists"}