Auto logging
AutoLoggerConfig
A Class for the Automated Logging Config
Source code in V3_2/src/super_gradients/common/auto_logging/auto_logger.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
|
get_log_file_path()
classmethod
Return the current log file used to store log messages
Returns:
Type | Description |
---|---|
str
|
Full path to log file |
Source code in V3_2/src/super_gradients/common/auto_logging/auto_logger.py
114 115 116 117 118 119 120 121 |
|
BufferWriter
File writer buffer that opens a file only when flushing and under the condition that threshold buffersize was reached.
Source code in V3_2/src/super_gradients/common/auto_logging/console_logging.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
__init__(filename, buffer, buffer_size, lock)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename |
str
|
Name of the file where to write the bugger |
required |
buffer |
StringIO
|
Buffer object |
required |
buffer_size |
int
|
Number of chars to be buffered before writing the buffer on disk. |
required |
lock |
Lock
|
Thread lock to prevent multiple threads to write at the same time |
required |
Source code in V3_2/src/super_gradients/common/auto_logging/console_logging.py
17 18 19 20 21 22 23 24 25 26 27 |
|
flush(force=False)
Write the buffer on disk if relevant.
Source code in V3_2/src/super_gradients/common/auto_logging/console_logging.py
36 37 38 39 40 41 42 43 44 |
|
write(data)
Write to buffer (not on disk).
Source code in V3_2/src/super_gradients/common/auto_logging/console_logging.py
29 30 31 32 33 34 |
|
ConsoleSink
Singleton responsible to sink the console streams (stdout/stderr) into a file.
Source code in V3_2/src/super_gradients/common/auto_logging/console_logging.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
|
flush()
staticmethod
Force the flush on stdout and stderr.
Source code in V3_2/src/super_gradients/common/auto_logging/console_logging.py
163 164 165 166 |
|
get_filename()
staticmethod
Get the filename of the sink.
Source code in V3_2/src/super_gradients/common/auto_logging/console_logging.py
168 169 170 171 |
|
set_location(filename)
staticmethod
Copy and redirect the sink file into another location.
Source code in V3_2/src/super_gradients/common/auto_logging/console_logging.py
152 153 154 155 |
|
StderrTee
Bases: BufferWriter
Duplicate the stderr stream to save it into a given file.
Source code in V3_2/src/super_gradients/common/auto_logging/console_logging.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
__init__(filename, buffer, buffer_size, lock)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename |
str
|
Name of the file where to write the bugger |
required |
buffer |
StringIO
|
Buffer object |
required |
buffer_size |
int
|
Number of chars to be buffered before writing the buffer on disk. |
required |
lock |
Lock
|
Thread lock to prevent multiple threads to write at the same time |
required |
Source code in V3_2/src/super_gradients/common/auto_logging/console_logging.py
54 55 56 57 58 59 60 61 62 63 |
|
StdoutTee
Bases: BufferWriter
Duplicate the stdout stream to save it into a given file.
Source code in V3_2/src/super_gradients/common/auto_logging/console_logging.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
|
__init__(filename, buffer, buffer_size, lock)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename |
str
|
Name of the file where to write the bugger |
required |
buffer |
Buffer object |
required | |
buffer_size |
int
|
Number of chars to be buffered before writing the buffer on disk. |
required |
lock |
Lock
|
Thread lock to prevent multiple threads to write at the same time |
required |
Source code in V3_2/src/super_gradients/common/auto_logging/console_logging.py
79 80 81 82 83 84 85 86 87 88 |
|
copy_file(src_filename, dest_filename, copy_mode='w')
Copy a file from source to destination. Also works when the destination folder does not exist.
Source code in V3_2/src/super_gradients/common/auto_logging/console_logging.py
101 102 103 104 105 106 107 |
|