question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What about using kotlin files without object?

See original GitHub issue

Currently 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:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pmwmediacommented, Mar 9, 2020

Actually, this works already today. For example, you can import the info() method of tinylog’s logger via import org.tinylog.kotlin.Logger.info and issue a log entry by info("Hello World!").

It works even with error() !

0reactions
github-actions[bot]commented, Oct 9, 2022

This closed issue has been locked automatically. However, please feel free to file a new issue.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found