/***************************************************************************
*   Copyright (C) 2004 by Denis A. Birukov aka Messenger of death         *
*   riper@fromru.com                                                      *
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU General Public License as published by  *
*   the Free Software Foundation; either version 2 of the License, or     *
*   (at your option) any later version.                                   *
*                                                                         *
*   This program is distributed in the hope that it will be useful,       *
*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
*   GNU General Public License for more details.                          *
*                                                                         *
*   You should have received a copy of the GNU General Public License     *
*   along with this program; if not, write to the                         *
*   Free Software Foundation, Inc.,                                       *
*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
***************************************************************************/
#include <me_c_text_log.h>
namespace ME_n_Log
{

	void ME_c_Text_Log::_log( std::string arg1, Uint8 pr )
	{
		if ( pr < _priority_ ) ( *_log_stream_ ) << arg1;
	}

	void ME_c_Text_Log::_set_priority( Uint8 arg1 )
	{
		_priority_ = arg1;
	}
	std::ostream& ME_c_Text_Log::_log( Uint8 pr )
	{
		if ( pr < _priority_ ) return * _log_stream_;
		else return std::cerr;
	}
	std::ostream& ME_c_Text_Log::_log()
	{
		return *_log_stream_;
	}
	ME_c_Text_Log::ME_c_Text_Log( std::ostream & z )
	{
		_log_stream_ = &z;
		_priority_ = 255;
	}

	ME_c_Text_Log::ME_c_Text_Log( std::string fname )
	{
		_log_stream_ = new std::ofstream( fname.c_str() );
		_priority_ = 255;
	}

}
