Skip to content

Commit 99da645

Browse files
authored
Small log and docs cleanup (#8417)
* fix ofMatrixStack error message spacing * fix missing whitespace in ofXml load warning * fix missing whitespace in ofFile copyTo and moveTo errors * fix missing whitespace after colon in numerous ofLogs, some log format consistency updates (mainly ofOpenALSoundPlayer * documentation: low level cleanups from 2016 for base types * remove unecessary log line leading whitespace * addon log leading whitespace
1 parent 3cd9f0f commit 99da645

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

addons/ofxAssimpModelLoader/src/ofxAssimpModelLoader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,11 @@ static GLint getGLFormatFromAiFormat(const char * aiFormat){
241241
return GL_RGB;
242242
}
243243
}else{
244-
ofLogError("getGLFormatFromAiFormat") << " can't parse format " << formatStr;
244+
ofLogError("getGLFormatFromAiFormat") << "can't parse format " << formatStr;
245245
}
246246
}
247247

248-
ofLogWarning("getGLFormatFromAiFormat") << " can't parse format " << formatStr << " returning GL_RGB";
248+
ofLogWarning("getGLFormatFromAiFormat") << "can't parse format " << formatStr << " returning GL_RGB";
249249
return GL_RGB;
250250
}
251251

addons/ofxKinect/src/ofxKinect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ float ofxKinect::reconnectWaitTime = 3.0;
4444

4545
//--------------------------------------------------------------------
4646
ofxKinect::ofxKinect() {
47-
ofLogVerbose("ofxKinect") <<" creating ofxKinect";
47+
ofLogVerbose("ofxKinect") << "creating ofxKinect";
4848

4949
deviceId = -1;
5050
serial = "";

addons/ofxNetwork/src/ofxUDPManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ bool ofxUDPManager::ConnectMcast(char* pMcast, unsigned short usPort)
266266
if (!Connect(pMcast, usPort))
267267
{
268268
#ifdef _DEBUG
269-
ofLogError("ofxUDPManager") << " ConnectMcast(): couldn't connect to socket";
269+
ofLogError("ofxUDPManager") << "ConnectMcast(): couldn't connect to socket";
270270
ofxNetworkLogLastError();
271271
#endif
272272
return false;

libs/openFrameworks/utils/ofURLFileLoader.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class ofHttpRequest {
1717
std::string url; ///< request url
1818
std::string name; ///< optional name key for sorting
1919
bool saveTo; ///< save to a file once the request is finished?
20-
bool close; // auto close connection at each request - default true
21-
bool verbose; // verbose packet logs
20+
bool close; ///< auto close connection at each request - default true
21+
bool verbose; ///< verbose packet logs
2222
std::map<std::string, std::string> headers; ///< HTTP header keys & values
2323
std::string body; ///< POST body data
2424
std::string contentType; ///< POST data mime type

libs/openFrameworks/video/ofAVFoundationGrabber.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ - (BOOL)initCapture:(int)framerate capWidth:(int)w capHeight:(int)h{
124124
bestFormat = format;
125125
}
126126

127-
ofLogVerbose("ofAvFoundationGrabber") << " supported dimensions are: " << dimensions.width << " " << dimensions.height;
127+
ofLogVerbose("ofAvFoundationGrabber") << "supported dimensions are: " << dimensions.width << " " << dimensions.height;
128128
}
129129

130130
// Set the new dimensions and format
131131
if( bestFormat != nullptr && bestW != 0 && bestH != 0 ){
132132
if( bestW != width || bestH != height ){
133-
ofLogWarning("ofAvFoundationGrabber") << " requested width and height aren't supported. Setting capture size to closest match: " << bestW << " by " << bestH<< std::endl;
133+
ofLogWarning("ofAvFoundationGrabber") << "requested width and height aren't supported. Setting capture size to closest match: " << bestW << " by " << bestH<< std::endl;
134134
}
135135

136136
[device setActiveFormat:bestFormat];
@@ -159,7 +159,7 @@ - (BOOL)initCapture:(int)framerate capWidth:(int)w capHeight:(int)h{
159159
device.activeVideoMinFrameDuration = desiredRange.minFrameDuration;
160160
device.activeVideoMaxFrameDuration = desiredRange.maxFrameDuration;
161161
}else{
162-
ofLogError("ofAvFoundationGrabber") << " could not set framerate to: " << framerate << ". Device supports: ";
162+
ofLogError("ofAvFoundationGrabber") << "could not set framerate to: " << framerate << ". Device supports: ";
163163
for(AVFrameRateRange * range in supportedFrameRates){
164164
ofLogError() << " framerate range of: " << range.minFrameRate <<
165165
" to " << range.maxFrameRate;
@@ -357,7 +357,7 @@ - (void)captureOutput:(AVCaptureOutput *)captureOutput
357357
size_t heightIn = CVPixelBufferGetHeight(imageBuffer);
358358

359359
if( widthIn != grabberPtr->getWidth() || heightIn != grabberPtr->getHeight() ){
360-
ofLogError("ofAVFoundationGrabber") << " incoming image dimensions " << widthIn << " by " << heightIn << " don't match. This shouldn't happen! Returning.";
360+
ofLogError("ofAVFoundationGrabber") << "incoming image dimensions " << widthIn << " by " << heightIn << " don't match. This shouldn't happen! Returning.";
361361
return;
362362
}
363363

libs/openFrameworks/video/ofMediaFoundationPlayer.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ bool ofMediaFoundationPlayer::MEDXDeviceManager::createDX11Device() {
101101
);
102102

103103
if (FAILED(hr)) {
104-
ofLogError("ofMEDXDeviceManager::CreateDX11Device()") << " unable to use hw accel.";
104+
ofLogError("ofMEDXDeviceManager::CreateDX11Device()") << "unable to use hw accel.";
105105
mBUseDX = false;
106106
return mBUseDX;
107107
}
@@ -110,22 +110,22 @@ bool ofMediaFoundationPlayer::MEDXDeviceManager::createDX11Device() {
110110
if (SUCCEEDED(m_spDX11Device.Get()->QueryInterface(IID_PPV_ARGS(&spMultithread)))) {
111111
spMultithread->SetMultithreadProtected(TRUE);
112112
} else {
113-
ofLogError("ofMEDXDeviceManager :: CreateDX11Device") << " unable to set multi thread.";
113+
ofLogError("ofMEDXDeviceManager::CreateDX11Device") << "unable to set multi thread.";
114114
mBUseDX = false;
115115
return mBUseDX;
116116
}
117117

118118

119119
hr = MFCreateDXGIDeviceManager(&mResetToken, &m_spDXGIManager);
120120
if (FAILED(hr)) {
121-
ofLogError("ofMEDXDeviceManager :: CreateDX11Device") << " unable to create DXGIDeviceManager.";
121+
ofLogError("ofMEDXDeviceManager::CreateDX11Device") << "unable to create DXGIDeviceManager.";
122122
mBUseDX = false;
123123
return mBUseDX;
124124
}
125125

126126
hr = m_spDXGIManager->ResetDevice(m_spDX11Device.Get(), mResetToken);
127127
if (FAILED(hr)) {
128-
ofLogError("ofMEDXDeviceManager :: CreateDX11Device") << " unable to ResetDevice.";
128+
ofLogError("ofMEDXDeviceManager::CreateDX11Device") << "unable to ResetDevice.";
129129
mBUseDX = false;
130130
return mBUseDX;
131131
}
@@ -137,7 +137,7 @@ bool ofMediaFoundationPlayer::MEDXDeviceManager::createDX11Device() {
137137
}
138138

139139
if (gl_handleD3D == nullptr) {
140-
ofLogError("ofMEDXDeviceManager :: CreateDX11Device") << " error creating GL D3D Handle.";
140+
ofLogError("ofMEDXDeviceManager::CreateDX11Device") << "error creating GL D3D Handle.";
141141
mBUseDX = false;
142142
}
143143

@@ -313,13 +313,13 @@ bool SharedDXGLTexture::create(DXGI_FORMAT aDxFormat) {
313313

314314
HRESULT hr = dxMan->getD11Device()->CreateTexture2D(&desc2, nullptr, stagingTexture.GetAddressOf());
315315
if (FAILED(hr)) {
316-
ofLogError("ofMEVideoPlayer :: SharedDXGLTexture :: create") << " Failed to create staging texture";
316+
ofLogError("ofMEVideoPlayer::SharedDXGLTexture::create") << "Failed to create staging texture";
317317
return false;
318318
}
319319

320320
mBValid = (mGLDX_Handle != nullptr);
321321
} else {
322-
ofLogError("SharedDXGLTexture :: createSharedTexture") << " ERROR Creating shared texture.";
322+
ofLogError("SharedDXGLTexture::createSharedTexture") << "ERROR Creating shared texture.";
323323
mBValid = false;
324324
}
325325
return mBValid;
@@ -391,7 +391,7 @@ bool SharedDXGLTexture::updatePixels(ofTexture& aSrcTex, ofPixels& apix, ofPixel
391391
immediateContext->CopyResource(stagingTexture.Get(), lDestImage);
392392
// copy the texture to a staging resource
393393
if (!stagingTexture) {
394-
ofLogError("ofMediaFoundationPlayer :: SharedDXGLTexture :: updatePixels") << " ERROR copying staging texture.";
394+
ofLogError("ofMediaFoundationPlayer :: SharedDXGLTexture :: updatePixels") << "ERROR copying staging texture.";
395395
return false;
396396
}
397397

@@ -403,13 +403,13 @@ bool SharedDXGLTexture::updatePixels(ofTexture& aSrcTex, ofPixels& apix, ofPixel
403403
0,
404404
&mapInfo);
405405
if (hr != S_OK) {
406-
ofLogError("ofMediaFoundationPlayer :: SharedDXGLTexture :: updatePixels") << " Failed to map staging texture.";
406+
ofLogError("ofMediaFoundationPlayer :: SharedDXGLTexture :: updatePixels") << "Failed to map staging texture.";
407407
return false;
408408
}
409409
immediateContext->Unmap(stagingTexture.Get(), 0);
410410

411411
if (FAILED(hr)) {
412-
ofLogVerbose("ofMediaFoundationPlayer :: SharedDXGLTexture :: updatePixels") << " unable to map hw dx texture.";
412+
ofLogVerbose("ofMediaFoundationPlayer :: SharedDXGLTexture :: updatePixels") << "unable to map hw dx texture.";
413413
aSrcTex.readToPixels(apix);
414414
return apix.getWidth() > 0;
415415
}

0 commit comments

Comments
 (0)