Projekt

Obecné

Profil

« Předchozí | Další » 

Revize ca436714

Přidáno uživatelem David Friesecký před téměř 4 roky(ů)

Re #8570 - Logger configuration
- implemented dictionary to string in utils
- implemented log functions with parameter message only (name of file, name of class and name of function
are getting automaticaly)

Zobrazit rozdíly:

src/utils/util.py
1 1
import datetime
2 2

  
3 3
import six
4
import typing
5 4

  
6 5

  
7 6
def _deserialize(data, klass):
......
139 138
    """
140 139
    return {k: _deserialize(v, boxed_type)
141 140
            for k, v in six.iteritems(data)}
141

  
142

  
143
def dict_to_string(data):
144
    data_str = ""
145
    for key, value in data.items():
146
        data_str += f"\t\t{key}"
147

  
148
        if type(value) is dict:
149
            data_str += " --\n"
150
            for subkey, subvalue in value.items():
151
                data_str += f"\t\t\t{subkey} : {subvalue}\n"
152
        else:
153
            data_str += f" : {value}\n"
154

  
155
    return data_str

Také k dispozici: Unified diff