Git Product home page Git Product logo

multiplatform-log's Introduction

Multiplatform Preferences

Use a single object : Logger in your kotlin shared projects to display logs

Note you can also use it in your real code on Android & iOs

Compatible with kotlin android and kotlin native for iphone

class MyPresenter {
    
    val TAG = "MyPresenter"

    fun start(){
        Logger.d(TAG, "my message")
        
        try{
            //myMethod
        } catch(e: Throwable){
            Logger.e(TAG, e.message, e)
        }
    }
}

Download

Add the repository

repositories {
    maven { url  "https://dl.bintray.com/florent37/maven" }
}

common

Download

implementation "com.github.florent37:multiplatform-log:1.5.0"

ios

Uses inside the Console / print

Download

implementation "com.github.florent37:multiplatform-log-ios:1.5.0"

android

Uses inside the Logcat

Download

implementation "com.github.florent37:multiplatform-log-android:1.5.0"

Disable logs on release

Enable the logger just on debug :

Logger.enabled = BuildConfig.DEBUG

Loggin methods

Debug

Log.d(TAG, message)

Error

Log.e(TAG, message, throwable)

License

Copyright 2018 Florent37

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

multiplatform-log's People

Contributors

florent37 avatar foso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

multiplatform-log's Issues

BuildConfig.DEBUG

BuildConfig.DEBUG is only available on Android and not on iOS. How to enable/disable the logs on iOS?

Misspelled github in gradle download instructions

implementation "com.gitub.florent37:multiplatform-log-android:1.0.0"
There's an "H" missing in "github" there so the dependency doesn't resolve :).

Also, it's not clear which version is to prefer. 0.0.9 or 1.0.0? The README gives conflicting instructions.

great and useful library btw ๐Ÿ‘

Incompatible Kotlin/Native libraries: Needs version compatible with Kotlin/Native 1.3.61

On gradle sync I'm getting:

Incompatible Kotlin/Native libraries:
There is a third-party library attached to the project that was compiled with an older Kotlin/Native
 compiler and can't be read in IDE: 
Gradle: com.github.florent37:multiplatform-log-ios_debug_ios_x64:klib:1.0.1  Please edit Gradle 
buildfile(s) and specify library version compatible with Kotlin/Native 1.3.61. Then re-import the project in IDE.

I see that version 1.0.2 is using kotlin 1.3.61
Was the v1.0.2 uploaded to maven?

Logger class is not available in 1.0.5

I add the 1.0.5 library, but the Logger class is not available to import there.
I cannot see the library in my External Libraries list.

With 1.0.1 it imports, but then iOS build fails with:

> Task :shared:compileKotlinIosArm64 FAILED
e: shared/Greeting.kt: (3, 12): Unresolved reference: github
e: shared/Greeting.kt: (8, 9): Unresolved reference: Logger

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.