Skip to content

Commit 7115b54

Browse files
committed
Remove mp4parse_log() from the C++ example.
Instead, when passed the '-v' switch, append 'debug' to the RUST_LOG environment variable, effecting the same change through env_logger.
1 parent 1fafa59 commit 7115b54

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

mp4parse_capi/examples/test.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,13 @@ int main(int argc, char* argv[])
234234
std::remove_if(args.begin(), args.end(), [](std::string& arg){
235235
if (!arg.compare("-v")) {
236236
fprintf(stderr, "Enabling debug logging.\n");
237-
mp4parse_log(true);
237+
const char* LOG_ENV = "RUST_LOG";
238+
auto logger = std::string(getenv(LOG_ENV));
239+
if (!logger.empty()) {
240+
logger.append(",");
241+
}
242+
logger.append("debug");
243+
setenv(LOG_ENV, logger.c_str(), 1);
238244
return true;
239245
}
240246
return false;

0 commit comments

Comments
 (0)