- add a log for testing mapping-functionality
[strongswan.git] / Source / charon / parser.c
index 3755a6e..b666379 100644 (file)
@@ -24,6 +24,8 @@
 #include <arpa/inet.h>
 
 #include "allocator.h"
+#include "definitions.h"
+#include "globals.h"
 #include "types.h"
 #include "parser.h"
 #include "logger.h"
@@ -125,6 +127,8 @@ static status_t parse_payload(private_parser_t *this, payload_type_t payload_typ
 {
        payload_info_t *payload_info = NULL;
        
+       this->logger->log(this->logger, CONTROL, "Parsing a %s payload", mapping_find(payload_type_t_mappings, payload_type));
+       
        /* find payload in null terminated list*/
        payload_info = *(this->payload_infos);
        while (payload_info)
@@ -379,7 +383,7 @@ static status_t parse_payload(private_parser_t *this, payload_type_t payload_typ
  */
 static status_t destroy(private_parser_t *this)
 {
-       this->logger->destroy(this->logger);
+       global_logger_manager->destroy_logger(global_logger_manager,this->logger);
        allocator_free(this);   
        
        return SUCCESS;
@@ -397,7 +401,8 @@ parser_t *parser_create(payload_info_t **payload_infos)
                return NULL;
        }
        
-       this->logger = logger_create("parser", ALL);
+       global_logger_manager->get_logger(global_logger_manager,PARSER,&(this->logger), NULL);
+       
        if (this->logger == NULL)
        {
                allocator_free(this);