Last active
September 30, 2019 21:46
-
-
Save prisonerjohn/508a5931b143bdd79d67981ac4d29260 to your computer and use it in GitHub Desktop.
Logging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ofApp.h" | |
void ofApp::setup() | |
{ | |
//ofSetLogLevel(OF_LOG_VERBOSE); | |
//ofSetLogLevel(OF_LOG_NOTICE); // default | |
ofSetLogLevel(OF_LOG_WARNING); | |
//ofSetLogLevel(OF_LOG_ERROR); | |
//ofSetLogLevel(OF_LOG_FATAL_ERROR); | |
//ofSetLogLevel(OF_LOG_SILENT); | |
ofLogToFile("log-" + ofGetTimestampString() + ".txt", true); | |
ofLogVerbose(__FUNCTION__) << "The app is now starting!"; | |
if (image.load("puppies.png")) | |
{ | |
float imageRatio = image.getWidth() / image.getHeight(); | |
if (imageRatio != 16 / 9) | |
{ | |
ofLogWarning(__FUNCTION__) << "Puppies image has the wrong aspect ratio " << imageRatio << ", it will be stretched!"; | |
} | |
else | |
{ | |
ofLogNotice(__FUNCTION__) << "Puppies image loaded successfully with dimensions " << image.getWidth() << "x" << image.getHeight() << "."; | |
} | |
} | |
else | |
{ | |
ofLogError(__FUNCTION__) << "Unable to load puppies image, make sure it's in the data folder!"; | |
} | |
if (grabber.setup(640, 480)) | |
{ | |
ofLogFatalError(__FUNCTION__) << "Unable to open camera, there's no reason to keep going :("; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ofApp.h" | |
void ofApp::setup() | |
{ | |
ofLog(OF_LOG_VERBOSE) << "The app is now starting!"; | |
if (image.load("puppies.png")) | |
{ | |
float imageRatio = image.getWidth() / image.getHeight(); | |
if (imageRatio != 16 / 9) | |
{ | |
ofLog(OF_LOG_WARNING) << "Puppies image has the wrong aspect ratio " << imageRatio <<", it will be stretched!"; | |
} | |
else | |
{ | |
ofLog(OF_LOG_NOTICE) << "Puppies image loaded successfully with dimensions " << image.getWidth() << "x" << image.getHeight() << "."; | |
} | |
} | |
else | |
{ | |
ofLog(OF_LOG_ERROR) << "Unable to load puppies image, make sure it's in the data folder!"; | |
} | |
if (grabber.setup(640, 480)) | |
{ | |
ofLog(OF_LOG_FATAL_ERROR) << "Unable to open camera, there's no reason to keep going :("; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ofApp.h" | |
void ofApp::setup() | |
{ | |
//ofSetLogLevel(OF_LOG_VERBOSE); | |
//ofSetLogLevel(OF_LOG_NOTICE); // default | |
ofSetLogLevel(OF_LOG_WARNING); | |
//ofSetLogLevel(OF_LOG_ERROR); | |
//ofSetLogLevel(OF_LOG_FATAL_ERROR); | |
//ofSetLogLevel(OF_LOG_SILENT); | |
ofLogVerbose(__FUNCTION__) << "The app is now starting!"; | |
if (image.load("puppies.png")) | |
{ | |
float imageRatio = image.getWidth() / image.getHeight(); | |
if (imageRatio != 16 / 9) | |
{ | |
ofLogWarning(__FUNCTION__) << "Puppies image has the wrong aspect ratio " << imageRatio <<", it will be stretched!"; | |
} | |
else | |
{ | |
ofLogNotice(__FUNCTION__) << "Puppies image loaded successfully with dimensions " << image.getWidth() << "x" << image.getHeight() << "."; | |
} | |
} | |
else | |
{ | |
ofLogError(__FUNCTION__) << "Unable to load puppies image, make sure it's in the data folder!"; | |
} | |
if (grabber.setup(640, 480)) | |
{ | |
ofLogFatalError(__FUNCTION__) << "Unable to open camera, there's no reason to keep going :("; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ofApp.h" | |
void ofApp::setup() | |
{ | |
//ofSetLogLevel(OF_LOG_VERBOSE); | |
//ofSetLogLevel(OF_LOG_NOTICE); // default | |
ofSetLogLevel(OF_LOG_WARNING); | |
//ofSetLogLevel(OF_LOG_ERROR); | |
//ofSetLogLevel(OF_LOG_FATAL_ERROR); | |
//ofSetLogLevel(OF_LOG_SILENT); | |
ofLogVerbose("App") << "The app is now starting!"; | |
if (image.load("puppies.png")) | |
{ | |
float imageRatio = image.getWidth() / image.getHeight(); | |
if (imageRatio != 16 / 9) | |
{ | |
ofLogWarning("Image Load") << "Puppies image has the wrong aspect ratio " << imageRatio <<", it will be stretched!"; | |
} | |
else | |
{ | |
ofLogNotice("Image Load") << "Puppies image loaded successfully with dimensions " << image.getWidth() << "x" << image.getHeight() << "."; | |
} | |
} | |
else | |
{ | |
ofLogError("Image Load") << "Unable to load puppies image, make sure it's in the data folder!"; | |
} | |
if (grabber.setup(640, 480)) | |
{ | |
ofLogFatalError("Grabber Setup") << "Unable to open camera, there's no reason to keep going :("; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ofApp.h" | |
void ofApp::setup() | |
{ | |
//ofSetLogLevel(OF_LOG_VERBOSE); | |
//ofSetLogLevel(OF_LOG_NOTICE); // default | |
ofSetLogLevel(OF_LOG_WARNING); | |
//ofSetLogLevel(OF_LOG_ERROR); | |
//ofSetLogLevel(OF_LOG_FATAL_ERROR); | |
//ofSetLogLevel(OF_LOG_SILENT); | |
ofLogVerbose() << "The app is now starting!"; | |
if (image.load("puppies.png")) | |
{ | |
float imageRatio = image.getWidth() / image.getHeight(); | |
if (imageRatio != 16 / 9) | |
{ | |
ofLogWarning() << "Puppies image has the wrong aspect ratio " << imageRatio <<", it will be stretched!"; | |
} | |
else | |
{ | |
ofLogNotice() << "Puppies image loaded successfully with dimensions " << image.getWidth() << "x" << image.getHeight() << "."; | |
} | |
} | |
else | |
{ | |
ofLogError() << "Unable to load puppies image, make sure it's in the data folder!"; | |
} | |
if (grabber.setup(640, 480)) | |
{ | |
ofLogFatalError() << "Unable to open camera, there's no reason to keep going :("; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ofApp.h" | |
void ofApp::setup() | |
{ | |
//ofSetLogLevel(OF_LOG_VERBOSE); | |
//ofSetLogLevel(OF_LOG_NOTICE); // default | |
ofSetLogLevel(OF_LOG_WARNING); | |
//ofSetLogLevel(OF_LOG_ERROR); | |
//ofSetLogLevel(OF_LOG_FATAL_ERROR); | |
//ofSetLogLevel(OF_LOG_SILENT); | |
ofLog(OF_LOG_VERBOSE) << "The app is now starting!"; | |
if (image.load("puppies.png")) | |
{ | |
float imageRatio = image.getWidth() / image.getHeight(); | |
if (imageRatio != 16 / 9) | |
{ | |
ofLog(OF_LOG_WARNING) << "Puppies image has the wrong aspect ratio " << imageRatio <<", it will be stretched!"; | |
} | |
else | |
{ | |
ofLog(OF_LOG_NOTICE) << "Puppies image loaded successfully with dimensions " << image.getWidth() << "x" << image.getHeight() << "."; | |
} | |
} | |
else | |
{ | |
ofLog(OF_LOG_ERROR) << "Unable to load puppies image, make sure it's in the data folder!"; | |
} | |
if (grabber.setup(640, 480)) | |
{ | |
ofLog(OF_LOG_FATAL_ERROR) << "Unable to open camera, there's no reason to keep going :("; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment