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.

Multiple arguments

See original GitHub issue

Hi! Can you please tell, it’s possible to achieve behavior with loguru.info() like print() function in case of multiple arguments?

For example, with print() i can do: print(1, 'abc', True), but loguru.info() takes only first argument for message.

I can reach desired result if i do:

loguru.info(', '.join([str(a) for a in (1, 'abc', True)]))

But make it every time too exhausting.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Delgancommented, Jan 31, 2020

Maybe that Loguru is not the best tool for “rapid debug”, and something more appropriate like icecream should be used instead? 😕

Anyway, I have another suggestion for the {module} / {function} problem: did you try to use opt() to force the context source to be retrieved from the parent function of you wrapper? Something like that:

def debug(*args):
    logger.opt(depth=1).info(" ".join(map(str, args)))
1reaction
filantuscommented, Jan 31, 2020

Yeah, it’s seems just what i wanted. Thank you very much!

P.S. I understand what loguru not aimed to rapid debugging, and it’s not only one purpose for i using loguru. But in some cases i don’t want install excess dependencies, just little more comfort with great tool like loguru. 🙂 Thank you again!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to pass multiple arguments to function ? - GeeksforGeeks
We can pass multiple arguments to a python function by predetermining the formal parameters in the function definition. Python. Python ...
Read more >
Variable-length arguments (*args, **kwargs) in Python
In the function, multiple arguments are received as a tuple. In the example, a tuple is passed to the sum() function to calculate...
Read more >
Multiple Function Arguments - Free Interactive Python Tutorial
Multiple Function Arguments. Every function in Python receives a predefined number of arguments, if declared normally, like this:.
Read more >
Python : *args | How to pass multiple arguments to function
In this article we will discuss how to define a function in python that can accept variable length arguments. Suppose we have a...
Read more >
Multiple Arguments and Parameters (How To) - Treehouse
Multiple Arguments and Parameters. What happens when you need to send more than one argument to a function?
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