Apache HTTP服务器 - 如何在模块上打印到控制台
Apache HTTP Server - How to print to console on modules?
我有一个apache http服务器模块,称为mod_mymodule.so在此处遵循文档。
我真的很想看到我自己的std::cout
s,所以我可以在运行时看到我的模块正在加载以及内部发生的事情,例如:
static int myserver_handler(request_rec *r)
{
std::cout << "WHY CAN'T I SEE THIS ON THE TERMINAL????" << std::endl; // <----????
return OK;
}
static void register_hooks(apr_pool_t *pool)
{
ap_hook_handler(myserver_handler, NULL, NULL, APR_HOOK_LAST);
}
module AP_MODULE_DECLARE_DATA tofserver_module =
{
STANDARD20_MODULE_STUFF,
NULL, // Per-directory configuration handler
NULL, // Merge handler for per-directory configurations
NULL, // Per-server configuration handler
NULL, // Merge handler for per-server configurations
NULL, // Any directives we may have for httpd
register_hooks // Our hook registering function
};
在调试模式下运行apache将输出到终端:
sudo apache2ctl -X
相关文章:
- 如何循环打印顶点结构
- 为什么在popback()操作之后,它仍然打印完整的矢量
- 尝试导入pybind-opencv模块时出现libgtk错误
- 如何在c++中打印目录
- 有一个打印语句的函数是一种糟糕的编程实践吗
- 在线编译器中的分段C++没有打印消息
- 在C++中打印指向不同基元数据类型的指针的内存地址
- 这个指针和内存代码打印是什么?我不知道是打印垃圾还是如何打印我需要的值
- 如何将结构插入到集合中并打印集合的成员
- 在循环C++中指定字符串之后,不会打印该字符串
- 以螺旋方式打印矩阵的程序.(工作不好)
- 从控制台中删除最后打印的元素
- 如何使用Crypto++并为RSA返回可打印的字节/字符数组
- 如何仅使用对象名称打印特定于对象的成员
- 回溯C++不打印函数,因此文件
- 如何在 ATL COM 模块中打印控制台输出
- Apache HTTP服务器 - 如何在模块上打印到控制台
- C++按模块名称选择性打印 cerr 流
- GDB 漂亮打印导入错误:没有名为"打印机"的模块
- 使用c++在内核模块中打印消息