NordicSemiconductor / Android-nRF-Mesh-Library

The Bluetooth Mesh Provisioner and Configurator library.
https://www.nordicsemi.com/
BSD 3-Clause "New" or "Revised" License
414 stars 177 forks source link

feat: Custom logger added with option to attach handler #522

Closed anees17861 closed 2 years ago

anees17861 commented 2 years ago

Added a static class MeshLogger. This class accepts a LogHandler object providable by app. If the LogHandler is null then it falls back to android.util.Log print statement.

closes #521

CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.

anees17861 commented 2 years ago

Hi @roshanrajaratnam,

Any update on reviewing this? I understand that the number of files to review is huge but just to make your life easier, I'll provide the summary of actions that I did:

Created MeshLogger file

Find and replaced all instances within the mesh module of the following import android.util.Log; with import no.nordicsemi.android.mesh.logger.MeshLogger; Log.v with MeshLogger.verbose Log.d with MeshLogger.debug Log.i with MeshLogger.info Log.w with MeshLogger.warn Log.e with MeshLogger.error

The only issue is if some other feature gets added with logs before this PR is merged, then the PR will need to be updated to accommodate those changes. I have unfortunately not found a way around this

roshanrajaratnam commented 2 years ago

Hi, thanks for your contribution and we really appreciate it. I have been a bit busy with some other stuff, I will get this merged today :)