Skip to content

Commit

Permalink
Fix iOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
irov committed Aug 4, 2023
1 parent 336710f commit 4835b1b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/Environment/Apple/AppleNSLogger.mm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
Char timestamp[256] = {'\0'};

const PlatformDateTime & dateTime = _message.dateTime;
size_t timestampSize = Helper::makeLoggerTimeStamp( dateTime, "[%02u:%02u:%02u:%04u]", timestamp, 0, 256 );
size_t timestampSize = Helper::makeLoggerShortDate( dateTime, "[%02u:%02u:%02u:%04u]", timestamp, 0, 256 );

MENGINE_STRCAT( message, timestamp );
MENGINE_STRCAT( message, " " );
Expand Down
3 changes: 0 additions & 3 deletions src/Plugins/AppleSentryPlugin/AppleSentryLoggerCapture.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ namespace Mengine

protected:
void _log( const LoggerMessage & _message ) override;

protected:
Char m_buffer[MENGINE_LOGGER_MAX_MESSAGE] = {'\0'};
};
//////////////////////////////////////////////////////////////////////////
typedef IntrusivePtr<AppleSentryLoggerCapture, LoggerInterface> AppleSentryLoggerCapturePtr;
Expand Down
20 changes: 10 additions & 10 deletions src/Plugins/AppleSentryPlugin/AppleSentryLoggerCapture.mm
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@
return;
}

MENGINE_STRCPY( m_buffer, "" );
Char buffer[MENGINE_LOGGER_MAX_MESSAGE] = {'\0'};

Char timestamp[256] = {'\0'};
size_t timestampSize = Helper::makeLoggerTimeStamp( _message.dateTime, "[%02u:%02u:%02u:%04u]", timestamp, 0, 256 );
MENGINE_STRNCAT( m_buffer, timestamp, timestampSize );
MENGINE_STRNCAT( m_buffer, " ", 1 );
size_t timestampSize = Helper::makeLoggerShortDate( _message.dateTime, "[%02u:%02u:%02u:%04u]", timestamp, 0, 256 );
MENGINE_STRNCAT( buffer, timestamp, timestampSize );
MENGINE_STRCAT( buffer, " " );

MENGINE_STRNCAT( m_buffer, "[", 1 );
MENGINE_STRCAT( m_buffer, _message.category );
MENGINE_STRNCAT( m_buffer, "]", 1 );
MENGINE_STRNCAT( m_buffer, " ", 1 );
MENGINE_STRCAT( buffer, "[" );
MENGINE_STRCAT( buffer, _message.category );
MENGINE_STRCAT( buffer, "]" );
MENGINE_STRCAT( buffer, " " );

const Char * data_str = _message.data;
size_t data_size = _message.size;

MENGINE_STRNCAT( m_buffer, data_str, data_size );
MENGINE_STRNCAT( buffer, data_str, data_size );

Helper::appleSentryMessageCapture( m_buffer );
Helper::appleSentryMessageCapture( buffer );
}
//////////////////////////////////////////////////////////////////////////
}
2 changes: 1 addition & 1 deletion src/Plugins/AppleSentryPlugin/AppleSentryService.mm
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
->getLocalDateTime( &dateTime );

Char LOG_TIMESTAMP[256] = {'\0'};
Helper::makeLoggerTimeStamp( dateTime, "[%02u:%02u:%02u:%04u]", LOG_TIMESTAMP, 0, 256 );
Helper::makeLoggerShortDate( dateTime, "[%02u:%02u:%02u:%04u]", LOG_TIMESTAMP, 0, 256 );

Helper::appleSentrySetExtraString( "Log Timestamp", LOG_TIMESTAMP );
Helper::appleSentrySetExtraBoolean( "Engine Stop", false );
Expand Down

0 comments on commit 4835b1b

Please sign in to comment.