Files
usercontainer/pam-module/examples/logging_example.cpp

18 lines
464 B
C++

// SPDX-License-Identifier: Apache-2.0
// C++ example demonstrating stream-style Rust logging wrapper
#include "../include/rust_backend_ffi.h"
#include <string>
int main() {
rust_init_logging(nullptr);
std::string user = "bob";
bool ok = true;
RUST_COUT() << "C++ example: user=" << user << " authenticated=" << (ok?"yes":"no") << std::flush;
RUST_CERR() << "C++ example: an error message for user=" << user << std::flush;
return 0;
}