Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RetroPlayer: Improve logging #13540

Merged
merged 1 commit into from
Feb 14, 2018
Merged

RetroPlayer: Improve logging #13540

merged 1 commit into from
Feb 14, 2018

Conversation

garbear
Copy link
Member

@garbear garbear commented Feb 12, 2018

The renderer was written kinda hastily, and I've been told that logging important information is lacking. This PR augments logging and clarifies which subsystem the log line originates from.

How Has This Been Tested?

RetroPlayer now produces the following log lines for normal gameplay (and from inspection, I've determined that most errors emit their error line):


// Kodi startup

 INFO: RetroPlayer[PROCESS]: Registering process control for X11
 INFO: RetroPlayer[RENDER]: Registering renderer factory for GUITexture

// Game load

 INFO: RetroPlayer[PROCESS]: Created process info for X11
DEBUG: RetroPlayer[PLAYER]: ---------------------------------------
DEBUG: RetroPlayer[PLAYER]: Game tag loaded
DEBUG: RetroPlayer[PLAYER]: URL:
DEBUG: RetroPlayer[PLAYER]: Title:
DEBUG: RetroPlayer[PLAYER]: Platform:
DEBUG: RetroPlayer[PLAYER]: Genres:
DEBUG: RetroPlayer[PLAYER]: Developer:
DEBUG: RetroPlayer[PLAYER]: Game Code:
DEBUG: RetroPlayer[PLAYER]: Region:
DEBUG: RetroPlayer[PLAYER]: Publisher:
DEBUG: RetroPlayer[PLAYER]: Format:
DEBUG: RetroPlayer[PLAYER]: Cartridge type:
DEBUG: RetroPlayer[PLAYER]: Game client: game.libretro.snes9x
DEBUG: RetroPlayer[PLAYER]: ---------------------------------------

// DLL load

DEBUG: RetroPlayer[AUDIO]: Initializing audio
DEBUG: RetroPlayer[VIDEO]: Initializing video
DEBUG: RetroPlayer[RENDER]: Initializing render manager
DEBUG: RetroPlayer[INPUT]: Initializing input
 INFO: RetroPlayer[PLAYER]: Opening: /home/garrett/Media/Software/ROMs (Unorganized)/Super Nintendo/Super Mario All-Stars (U) [!].smc

// Game load

DEBUG: RetroPlayer[PLAYER]: Using game client game.libretro.snes9x
DEBUG: RetroPlayer[SAVE]: Loading savestate /home/garrett/Media/Software/ROMs (Unorganized)/Super Nintendo/Super Mario All-Stars (U) [!].xml
DEBUG: RetroPlayer[SAVE]: Initializing autosave
DEBUG: Thread CRetroPlayerAutoSave start, auto delete: false
DEBUG: RetroPlayer[SAVE]: Autosave thread started
 INFO: RetroPlayer[AUDIO]: Creating audio stream, sample rate = 32000

// Create audio stream

DEBUG: RetroPlayer[VIDEO]: Creating video stream 256x224
 INFO: RetroPlayer[RENDER]: Configuring format RGB565, 256x224, 0 deg
 INFO: RetroPlayer[RENDER]: Renderer configured

// First frame

DEBUG: RetorPlayer[RENDER]: Configuring buffer pool
DEBUG: RetroPlayer[RENDER]: Creating render buffer for buffer pool
DEBUG: Previous line repeats 2 times.

// Gameplay, then close file

DEBUG: RetroPlayer[PLAYER]: Closing file
DEBUG: RetroPlayer[SAVE]: Deinitializing autosave
DEBUG: RetroPlayer[SAVE]: Autosave thread ended
DEBUG: RetroPlayer[SAVE]: Saved state to /home/garrett/Media/Software/ROMs (Unorganized)/Super Nintendo/Super Mario All-Stars (U) [!].sav

// Unload DLL

DEBUG: RetroPlayer[AUDIO]: Deinitializing audio
DEBUG: RetroPlayer[AUDIO]: Closing stream

// Close audio stream

DEBUG: RetroPlayer[VIDEO]: Deinitializing video
DEBUG: RetroPlayer[VIDEO]: Closing stream
DEBUG: RetroPlayer[RENDER]: Deinitializing render manager
DEBUG: RetroPlayer[PLAYER]: Closing file
DEBUG: RetroPlayer[INPUT]: Deinitializing input

It kinda highlights that some things aren't strictly ordered. I may reorder some stuff before merging.

@lrusak would you like to see any additional information?

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@garbear garbear requested a review from lrusak February 12, 2018 23:20
@garbear garbear added this to the L 18.0-alpha1 milestone Feb 12, 2018
@lrusak
Copy link
Contributor

lrusak commented Feb 13, 2018

Thanks dude looks great! merge away!

CloseStream();
m_renderManager.Deinitialize();
}

bool CRetroPlayerVideo::OpenPixelStream(AVPixelFormat pixfmt, unsigned int width, unsigned int height, unsigned int orientationDeg)
{
CLog::Log(LOGINFO, "RetroPlayerVideo: Creating video stream with pixel format: %i, %dx%d", pixfmt, width, height);
CLog::Log(LOGDEBUG, "RetroPlayer[VIDEO]: Creating video stream %ux%u", width, height);

This comment was marked as spam.

@@ -76,7 +77,15 @@ bool CRPBaseRenderer::Configure(AVPixelFormat format, unsigned int width, unsign
m_renderOrientation = orientation;

if (!m_bufferPool->IsConfigured())
m_bufferPool->Configure(format, width, height);
{
CLog::Log(LOGDEBUG, "RetorPlayer[RENDER]: Configuring buffer pool");

This comment was marked as spam.


if (!m_bufferPool->Configure(format, width, height))
{
CLog::Log(LOGERROR, "RetorPlayer[RENDER]: Failed to configure buffer pool");

This comment was marked as spam.

@garbear
Copy link
Member Author

garbear commented Feb 14, 2018

Beefed up logging a little more. jenkins build this please

@garbear
Copy link
Member Author

garbear commented Feb 14, 2018

jenkins build this please

@garbear
Copy link
Member Author

garbear commented Feb 14, 2018

linux64 error in test suite

@garbear garbear merged commit cc5232c into xbmc:master Feb 14, 2018
@garbear garbear deleted the rp-logging branch February 14, 2018 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants