What about using kotlin files without object?
See original GitHub issueCurrently if we use kotlin module need type Logger.info()
for minimal logging any message.
But, we can just remove object and it will looks like info()
or warn()
, but possible conflicts with error()
with kotlin error() // in kotlin it alias for throw()
what does throwing exceptions.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
When should I use Object type vs straight Kotlin file
In an app, I would lean towards putting the functions on some type, whether that is an object , an existing type (extension...
Read more >Visibility modifiers | Kotlin
Classes, objects, interfaces, constructors, and functions, as well as properties and their setters, can have visibility modifiers.
Read more >Calling Kotlin from Java
Kotlin properties declared in a named object or a companion object will have static backing fields either in that named object or in...
Read more >Object expressions and declarations - Kotlin
Object expressions create objects of anonymous classes, that is, classes that aren't explicitly declared with the class declaration.
Read more >Packages and imports - Kotlin
If the package is not specified, the contents of such a file belong to the default package with no name. Default imports. A...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Actually, this works already today. For example, you can import the
info()
method of tinylog’s logger viaimport org.tinylog.kotlin.Logger.info
and issue a log entry byinfo("Hello World!")
.It works even with
error()
!This closed issue has been locked automatically. However, please feel free to file a new issue.