SergiusTheBest / plog

Portable, simple and extensible C++ logging library
MIT License
2.19k stars 385 forks source link

[Feature Request] std::string to plog::nstring/plog::nchar #254

Closed Icyfiremario closed 1 year ago

Icyfiremario commented 1 year ago

I want to be able to use a filename I generated that contains the date and the time using boost::date_time() but it is type std::string while the data type required for the filename in plog::init is plog::nchar.

Icyfiremario commented 1 year ago

Nvm figured out how to convert using some type casting, I was just not thinking properly.

Implementation for anyone who needs it:

std::string str; const plog::util:nchar* char = str.c_str();

SergiusTheBest commented 1 year ago

@Icyfiremario Yes, you just use .c_str(), for example: plog::init(plog::debug, filename.c_str());