Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
deleted 8 characters in body
Source Link

Alternatively, define a function that accepts *args and then join them in your call to logger:

def log(*args, logtype='debug', sep=' '): getattr(logger, logtype)(sep.join("{}".formatstr(a) for a in args)) 

I added a logtype for flexibility here but you could remove it if not required.

Alternatively, define a function that accepts *args and then join them in your call to logger:

def log(*args, logtype='debug', sep=' '): getattr(logger, logtype)(sep.join("{}".format(a) for a in args)) 

I added a logtype for flexibility here but you could remove it if not required.

Alternatively, define a function that accepts *args and then join them in your call to logger:

def log(*args, logtype='debug', sep=' '): getattr(logger, logtype)(sep.join(str(a) for a in args)) 

I added a logtype for flexibility here but you could remove it if not required.

added 9 characters in body
Source Link

Alternatively, define a function that accepts *args and then join them in your call to logger:

def log(*args, logtype='debug', sep=' '): getattr(logger, logtype)(sep.join("{}".format(a) for a in args)) 

I added a logtype for flexibility here but you could remove it if not required.

Alternatively, define a function that accepts *args and then join them in your call to logger:

def log(*args, logtype='debug', sep=' '): getattr(logger, logtype)(sep.join(args)) 

I added a logtype for flexibility here but you could remove it if not required.

Alternatively, define a function that accepts *args and then join them in your call to logger:

def log(*args, logtype='debug', sep=' '): getattr(logger, logtype)(sep.join("{}".format(a) for a in args)) 

I added a logtype for flexibility here but you could remove it if not required.

added 9 characters in body
Source Link

Alternatively, define a function that accepts *args and then join them in your call to logger:

def log(*args, logtype='debug', sep=' '): getattr(logger, logtype)(" "sep.join(args)) 

I added a logtype for flexibility here but you could remove it if not required.

Alternatively, define a function that accepts *args and then join them in your call to logger:

def log(*args, logtype='debug'): getattr(logger, logtype)(" ".join(args)) 

I added a logtype for flexibility here but you could remove it if not required.

Alternatively, define a function that accepts *args and then join them in your call to logger:

def log(*args, logtype='debug', sep=' '): getattr(logger, logtype)(sep.join(args)) 

I added a logtype for flexibility here but you could remove it if not required.

Source Link
Loading