@@ -16,7 +16,7 @@ See the License for the specific language governing permissions and
1616limitations under the License.
1717*/
1818
19- import { getPrefixedLogger , logger } from '../logger' ;
19+ import { logger } from '../logger' ;
2020import { IndexedDBCryptoStore } from './store/indexeddb-crypto-store' ;
2121import * as algorithms from './algorithms' ;
2222
@@ -545,7 +545,7 @@ OlmDevice.prototype.createOutboundSession = async function(
545545 }
546546 } ) ;
547547 } ,
548- getPrefixedLogger ( "[createOutboundSession]" ) ,
548+ logger . withPrefix ( "[createOutboundSession]" ) ,
549549 ) ;
550550 return newSessionId ;
551551} ;
@@ -606,7 +606,7 @@ OlmDevice.prototype.createInboundSession = async function(
606606 }
607607 } ) ;
608608 } ,
609- getPrefixedLogger ( "[createInboundSession]" ) ,
609+ logger . withPrefix ( "[createInboundSession]" ) ,
610610 ) ;
611611
612612 return result ;
@@ -621,7 +621,7 @@ OlmDevice.prototype.createInboundSession = async function(
621621 * @return {Promise<string[]> } a list of known session ids for the device
622622 */
623623OlmDevice . prototype . getSessionIdsForDevice = async function ( theirDeviceIdentityKey ) {
624- const log = getPrefixedLogger ( "[getSessionIdsForDevice]" ) ;
624+ const log = logger . withPrefix ( "[getSessionIdsForDevice]" ) ;
625625
626626 if ( this . _sessionsInProgress [ theirDeviceIdentityKey ] ) {
627627 log . debug ( `Waiting for Olm session for ${ theirDeviceIdentityKey } to be created` ) ;
@@ -705,7 +705,7 @@ OlmDevice.prototype.getSessionIdForDevice = async function(
705705 * @return {Array.<{sessionId: string, hasReceivedMessage: Boolean}> }
706706 */
707707OlmDevice . prototype . getSessionInfoForDevice = async function ( deviceIdentityKey , nowait ) {
708- const log = getPrefixedLogger ( "[getSessionInfoForDevice]" ) ;
708+ const log = logger . withPrefix ( "[getSessionInfoForDevice]" ) ;
709709
710710 if ( this . _sessionsInProgress [ deviceIdentityKey ] && ! nowait ) {
711711 log . debug ( `Waiting for Olm session for ${ deviceIdentityKey } to be created` ) ;
@@ -769,7 +769,7 @@ OlmDevice.prototype.encryptMessage = async function(
769769 this . _saveSession ( theirDeviceIdentityKey , sessionInfo , txn ) ;
770770 } ) ;
771771 } ,
772- getPrefixedLogger ( "[encryptMessage]" ) ,
772+ logger . withPrefix ( "[encryptMessage]" ) ,
773773 ) ;
774774 return res ;
775775} ;
@@ -803,7 +803,7 @@ OlmDevice.prototype.decryptMessage = async function(
803803 this . _saveSession ( theirDeviceIdentityKey , sessionInfo , txn ) ;
804804 } ) ;
805805 } ,
806- getPrefixedLogger ( "[decryptMessage]" ) ,
806+ logger . withPrefix ( "[decryptMessage]" ) ,
807807 ) ;
808808 return payloadString ;
809809} ;
@@ -835,7 +835,7 @@ OlmDevice.prototype.matchesSession = async function(
835835 matches = sessionInfo . session . matches_inbound ( ciphertext ) ;
836836 } ) ;
837837 } ,
838- getPrefixedLogger ( "[matchesSession]" ) ,
838+ logger . withPrefix ( "[matchesSession]" ) ,
839839 ) ;
840840 return matches ;
841841} ;
@@ -1106,7 +1106,7 @@ OlmDevice.prototype.addInboundGroupSession = async function(
11061106 } ,
11071107 ) ;
11081108 } ,
1109- getPrefixedLogger ( "[addInboundGroupSession]" ) ,
1109+ logger . withPrefix ( "[addInboundGroupSession]" ) ,
11101110 ) ;
11111111} ;
11121112
@@ -1277,7 +1277,7 @@ OlmDevice.prototype.decryptGroupMessage = async function(
12771277 } ,
12781278 ) ;
12791279 } ,
1280- getPrefixedLogger ( "[decryptGroupMessage]" ) ,
1280+ logger . withPrefix ( "[decryptGroupMessage]" ) ,
12811281 ) ;
12821282
12831283 if ( error ) {
@@ -1323,7 +1323,7 @@ OlmDevice.prototype.hasInboundSessionKeys = async function(roomId, senderKey, se
13231323 } ,
13241324 ) ;
13251325 } ,
1326- getPrefixedLogger ( "[hasInboundSessionKeys]" ) ,
1326+ logger . withPrefix ( "[hasInboundSessionKeys]" ) ,
13271327 ) ;
13281328
13291329 return result ;
@@ -1383,7 +1383,7 @@ OlmDevice.prototype.getInboundGroupSessionKey = async function(
13831383 } ,
13841384 ) ;
13851385 } ,
1386- getPrefixedLogger ( "[getInboundGroupSessionKey]" ) ,
1386+ logger . withPrefix ( "[getInboundGroupSessionKey]" ) ,
13871387 ) ;
13881388
13891389 return result ;
0 commit comments