I am attempting to keep a log of when a user does certain things but when a new log event is reached the second log is overwritten instead of adding a new one to the array I am unsure as to why when push should not replace anything.
struct logger {
bytes32[] who;
uint64[]when;
}
mapping(address => logger) log;
function LogEvent( bytes32 _username, address _userAddress, uint64 _timestamp) public{
log[_userAddress].who.push(_username);
log[_userAddress].when.push(_timestamp);
}
function getlogs(address _userAddress) view public returns(bytes32[] memory, uint64[] memory){
return(log[_userAddress].who, log[_userAddress].when);
}