mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-python
synced 2026-01-15 09:53:32 +01:00
log.remove_from_prefix(): Add support for str argument
In addition to an integer, a string can now be passed, which allows prefix = ' | ' append_to_prefix(prefix) slog(INFO, "something") remove_from_prefix(prefx) Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
86e25a2dfb
commit
4a047ca260
1 changed files with 3 additions and 1 deletions
|
|
@ -220,7 +220,9 @@ def append_to_prefix(prefix: str) -> str: # export
|
|||
_log_prefix += prefix
|
||||
return r
|
||||
|
||||
def remove_from_prefix(count: int) -> str: # export
|
||||
def remove_from_prefix(count) -> str: # export
|
||||
if isinstance(count, str):
|
||||
count = len(count)
|
||||
global _log_prefix
|
||||
r = _log_prefix
|
||||
_log_prefix = _log_prefix[:-count]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue