Format log message to add keyspace and connection context
(msg, connection=None, keyspace=None)
| 43 | |
| 44 | |
| 45 | def format_log_context(msg, connection=None, keyspace=None): |
| 46 | """Format log message to add keyspace and connection context""" |
| 47 | connection_info = connection or 'DEFAULT_CONNECTION' |
| 48 | |
| 49 | if keyspace: |
| 50 | msg = '[Connection: {0}, Keyspace: {1}] {2}'.format(connection_info, keyspace, msg) |
| 51 | else: |
| 52 | msg = '[Connection: {0}] {1}'.format(connection_info, msg) |
| 53 | return msg |
| 54 | |
| 55 | |
| 56 | class UndefinedKeyspaceException(CQLEngineException): |
no outgoing calls
no test coverage detected