<commit_before>#include "cinder/app/AppBasic.h"

#include "cinder/Log.h"

#define CI_ASSERT_DEBUG_BREAK
#include "cinder/CinderAssert.h"

using namespace ci;
using namespace ci::app;
using namespace std;

class DebugTestApp : public AppBasic {
	void setup();

	void testEnableFile();
	void testEnableBadFilePath();
	void testEnableDisable();
	void testAddFile();
	void testAddRemove();
	void testAsserts();


	void keyDown( KeyEvent event );

};

void DebugTestApp::setup()
{
//	log::manager()->resetLogger( new log::LoggerNSLog );
//	log::manager()->enableSystemLogging();


	testEnableBadFilePath();
	//testEnableFile();
//	testEnableDisable();
//	testAddRemove();
}

void DebugTestApp::testAsserts()
{
	int i = 0;
	CI_VERIFY( ( i += 1 ) );

	CI_LOG_I( "i = " << i ); // should be 1 in both debug and release

//	CI_ASSERT( false );
//	CI_ASSERT_MSG( false, "blarg" );
}

void DebugTestApp::testEnableFile()
{
	log::manager()->enableFileLogging();
//	log::manager()->enableFileLogging( "/tmp/blarg/cinder.log" );
//	log::manager()->enableFileLogging( "/tmp", "loggingTests.%Y.%m.%d.log", false );
//	log::manager()->enableFileLogging( "/tmp/cinder", "loggingTests.%Y.%m.%d.log", false );

	CI_LOG_I( "enabled file logger" );
}

void DebugTestApp::testEnableDisable()
{
	log::manager()->enableFileLogging();
	CI_LOG_I( "enabled file logger" );

	log::manager()->disableFileLogging();
	CI_LOG_I( "disable file logger" );
}

void DebugTestApp::testAddFile()
{
	log::manager()->addLogger( new log::LoggerFileThreadSafe );

	CI_LOG_I( "added file logger" );
}

void DebugTestApp::testAddRemove()
{
	auto logger = new log::LoggerNSLog;
	log::manager()->addLogger( logger );
	CI_LOG_I( "added LoggerNSLog" );
	log::manager()->removeLogger( logger );
	CI_LOG_I( "removed LoggerNSLog" );
}

void DebugTestApp::testEnableBadFilePath()
{
	log::manager()->enableFileLogging( "ABCDE:/Volumes/__THISDOESNOTEXIST_gf5jk313__/tmp/cinder.log" );
	
	CI_LOG_I( "This should hit the console but not deal with the bad files." );
}


void DebugTestApp::keyDown( KeyEvent event )
{
	auto loggers = log::manager()->getAllLoggers();
	CI_LOG_I( "event char: " << event.getChar() << ", code: " << event.getCode() );
}

CINDER_APP_BASIC( DebugTestApp, Renderer2d )<commit_msg>update DebugTest for app_refactor changes <commit_after>#include "cinder/app/App.h"

#include "cinder/Log.h"

#define CI_ASSERT_DEBUG_BREAK
#include "cinder/CinderAssert.h"

using namespace ci;
using namespace ci::app;
using namespace std;

class DebugTestApp : public App {
	void setup();

	void testEnableFile();
	void testEnableBadFilePath();
	void testEnableDisable();
	void testAddFile();
	void testAddRemove();
	void testAsserts();


	void keyDown( KeyEvent event );

};

void DebugTestApp::setup()
{
//	log::manager()->resetLogger( new log::LoggerNSLog );
//	log::manager()->enableSystemLogging();


	testEnableBadFilePath();
	//testEnableFile();
//	testEnableDisable();
//	testAddRemove();
}

void DebugTestApp::testAsserts()
{
	int i = 0;
	CI_VERIFY( ( i += 1 ) );

	CI_LOG_I( "i = " << i ); // should be 1 in both debug and release

//	CI_ASSERT( false );
//	CI_ASSERT_MSG( false, "blarg" );
}

void DebugTestApp::testEnableFile()
{
	log::manager()->enableFileLogging();
//	log::manager()->enableFileLogging( "/tmp/blarg/cinder.log" );
//	log::manager()->enableFileLogging( "/tmp", "loggingTests.%Y.%m.%d.log", false );
//	log::manager()->enableFileLogging( "/tmp/cinder", "loggingTests.%Y.%m.%d.log", false );

	CI_LOG_I( "enabled file logger" );
}

void DebugTestApp::testEnableDisable()
{
	log::manager()->enableFileLogging();
	CI_LOG_I( "enabled file logger" );

	log::manager()->disableFileLogging();
	CI_LOG_I( "disable file logger" );
}

void DebugTestApp::testAddFile()
{
	log::manager()->addLogger( new log::LoggerFileThreadSafe );

	CI_LOG_I( "added file logger" );
}

void DebugTestApp::testAddRemove()
{
	auto logger = new log::LoggerNSLog;
	log::manager()->addLogger( logger );
	CI_LOG_I( "added LoggerNSLog" );
	log::manager()->removeLogger( logger );
	CI_LOG_I( "removed LoggerNSLog" );
}

void DebugTestApp::testEnableBadFilePath()
{
	log::manager()->enableFileLogging( "ABCDE:/Volumes/__THISDOESNOTEXIST_gf5jk313__/tmp/cinder.log" );
	
	CI_LOG_I( "This should hit the console but not deal with the bad files." );
}


void DebugTestApp::keyDown( KeyEvent event )
{
	auto loggers = log::manager()->getAllLoggers();
	CI_LOG_I( "event char: " << event.getChar() << ", code: " << event.getCode() );
}

CINDER_APP( DebugTestApp, Renderer2d )
{'fraction_non_alphanumeric': 0.1733540234981157, 'fraction_numerical': 0.0035468853912657946, 'mean_word_length': 5.427350427350428, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5280584', 'n_tokens_mistral': 1625, 'n_tokens_neox': 1567, 'n_words': 325}