Skip to content
Snippets Groups Projects
Select Git revision
  • d07d891d7b8b00dd312f933a789c73db8964c98f
  • master default
2 results

pykat_output.kat

Blame
  • Forked from finesse / pykat
    Source project has a limited visibility.
    log_flags.cpp 13.37 KiB
    // This file is part of BOINC.
    // http://boinc.berkeley.edu
    // Copyright (C) 2008 University of California
    //
    // BOINC is free software; you can redistribute it and/or modify it
    // under the terms of the GNU Lesser General Public License
    // as published by the Free Software Foundation,
    // either version 3 of the License, or (at your option) any later version.
    //
    // BOINC is distributed in the hope that it will be useful,
    // but WITHOUT ANY WARRANTY; without even the implied warranty of
    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    // See the GNU Lesser General Public License for more details.
    //
    // You should have received a copy of the GNU Lesser General Public License
    // along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
    
    #include "cpp.h"
    
    #ifdef _WIN32
    #include "boinc_win.h"
    #ifdef _MSC_VER
    #define chdir _chdir
    #endif
    #endif
    
    #ifndef _WIN32
    #include "config.h"
    #include <cstdio>
    #include <cstring>
    #include <unistd.h>
    #endif
    
    #include "error_numbers.h"
    #include "common_defs.h"
    #include "file_names.h"
    #include "client_state.h"
    #include "client_msgs.h"
    #include "parse.h"
    #include "str_util.h"
    #include "filesys.h"
    
    using std::string;
    
    LOG_FLAGS log_flags;
    CONFIG config;
    
    LOG_FLAGS::LOG_FLAGS() {
        memset(this, 0, sizeof(LOG_FLAGS));
        // on by default (others are off by default)
        //
        task = true;
        file_xfer = true;
        sched_ops = true;
    }
    
    // Parse log flag preferences
    //
    int LOG_FLAGS::parse(XML_PARSER& xp) {
        char tag[1024];
        bool is_tag;
    
        while (!xp.get(tag, sizeof(tag), is_tag)) {
            if (!is_tag) {
                msg_printf(NULL, MSG_USER_ERROR,
                   "Unexpected text %s in %s", tag, CONFIG_FILE
                );
                continue;
            }
            if (!strcmp(tag, "/log_flags")) return 0;