-/* Copyright 2000-2004 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
return ((void **)cv)[m->module_index];
}
+#if defined(ap_get_server_module_loglevel)
+#undef ap_get_server_module_loglevel
+AP_DECLARE(int) ap_get_server_module_loglevel(const server_rec *s, int module_index);
+#endif
+
+AP_DECLARE(int) ap_get_server_module_loglevel(const server_rec *s, int module_index)
+{
+ if (module_index < 0 || s->log.module_levels == NULL ||
+ s->log.module_levels[module_index] < 0)
+ {
+ return s->log.level;
+ }
+
+ return s->log.module_levels[module_index];
+}
+
+#if defined(ap_get_conn_module_loglevel)
+#undef ap_get_conn_module_loglevel
+AP_DECLARE(int) ap_get_conn_module_loglevel(const conn_rec *c, int module_index);
+#endif
+
+AP_DECLARE(int) ap_get_conn_module_loglevel(const conn_rec *c, int module_index)
+{
+ const struct ap_logconf *l = (c)->log ? (c)->log : &(c)->base_server->log;
+ if (module_index < 0 || l->module_levels == NULL ||
+ l->module_levels[module_index] < 0)
+ {
+ return l->level;
+ }
+
+ return l->module_levels[module_index];
+}
+
+#if defined(ap_get_conn_server_module_loglevel)
+#undef ap_get_conn_server_module_loglevel
+AP_DECLARE(int) ap_get_conn_server_module_loglevel(const conn_rec *c,
+ const server_rec *s,
+ int module_index);
+#endif
+
+AP_DECLARE(int) ap_get_conn_server_module_loglevel(const conn_rec *c,
+ const server_rec *s,
+ int module_index)
+{
+ const struct ap_logconf *l = (c->log && c->log != &c->base_server->log) ?
+ c->log : &s->log;
+ if (module_index < 0 || l->module_levels == NULL ||
+ l->module_levels[module_index] < 0)
+ {
+ return l->level;
+ }
+
+ return l->module_levels[module_index];
+}
+
+#if defined(ap_get_request_module_loglevel)
+#undef ap_get_request_module_loglevel
+AP_DECLARE(int) ap_get_request_module_loglevel(const request_rec *c, int module_index);
+#endif
+
+AP_DECLARE(int) ap_get_request_module_loglevel(const request_rec *r, int module_index)
+{
+ const struct ap_logconf *l = r->log ? r->log :
+ r->connection->log ? r->connection->log :
+ &r->server->log;
+ if (module_index < 0 || l->module_levels == NULL ||
+ l->module_levels[module_index] < 0)
+ {
+ return l->level;
+ }
+
+ return l->module_levels[module_index];
+}
+
/**
* Generic accessors for other modules to set at their own module-specific
* data
* usually r->per_dir_config or s->module_config
* @param m The module to set the data for.
* @param val The module-specific data to set
- * @deffunc void ap_set_module_config(ap_conf_vector_t *cv, const module *m, void *val)
+ * @fn void ap_set_module_config(ap_conf_vector_t *cv, const module *m, void *val)
*/
#if defined(ap_set_module_config)
#undef ap_set_module_config