made debug.hpp build without exception support
This commit is contained in:
parent
588d59b9f2
commit
07b4024024
|
@ -60,17 +60,21 @@ namespace libtorrent
|
||||||
{
|
{
|
||||||
logger(fs::path const& logpath, fs::path const& filename, int instance, bool append = true)
|
logger(fs::path const& logpath, fs::path const& filename, int instance, bool append = true)
|
||||||
{
|
{
|
||||||
|
#ifndef BOOST_NO_EXCEPTIONS
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
#endif
|
||||||
fs::path dir(fs::complete(logpath / ("libtorrent_logs" + boost::lexical_cast<std::string>(instance))));
|
fs::path dir(fs::complete(logpath / ("libtorrent_logs" + boost::lexical_cast<std::string>(instance))));
|
||||||
if (!fs::exists(dir)) fs::create_directories(dir);
|
if (!fs::exists(dir)) fs::create_directories(dir);
|
||||||
m_file.open((dir / filename).string().c_str(), std::ios_base::out | (append ? std::ios_base::app : std::ios_base::out));
|
m_file.open((dir / filename).string().c_str(), std::ios_base::out | (append ? std::ios_base::app : std::ios_base::out));
|
||||||
*this << "\n\n\n*** starting log ***\n";
|
*this << "\n\n\n*** starting log ***\n";
|
||||||
|
#ifndef BOOST_NO_EXCEPTIONS
|
||||||
}
|
}
|
||||||
catch (std::exception& e)
|
catch (std::exception& e)
|
||||||
{
|
{
|
||||||
std::cerr << "failed to create log '" << filename.string() << "': " << e.what() << std::endl;
|
std::cerr << "failed to create log '" << filename.string() << "': " << e.what() << std::endl;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
|
|
Loading…
Reference in New Issue