Changeset 375 for cpp/frams/_demos


Ignore:
Timestamp:
04/26/15 00:59:09 (10 years ago)
Author:
Maciej Komosinski
Message:

Renamed logging functions to more intuitive and simple names

Location:
cpp/frams/_demos
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/_demos/f0_variants_test.cpp

    r372 r375  
    1010#include <frams/genetics/defgenoconv.h>
    1111#include <frams/model/model.h>
    12 #include <frams/mhandlers/stdouthandler.h>
     12#include <frams/loggers/loggertostdout.h>
    1313
    1414void save_as_f0(SString &gen,Model &m,bool omit_default_values)
     
    7474int main(int argc,char*argv[])
    7575{
    76 MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable);
     76LoggerToStdout messages_to_stdout(LoggerBase::Enable);
    7777
    7878//without converters the application would only handle "format 0" genotypes
  • cpp/frams/_demos/full_props.cpp

    r372 r375  
    99
    1010#include <frams/model/model.h>
    11 #include <frams/mhandlers/stdouthandler.h>
     11#include <frams/loggers/loggertostdout.h>
    1212#include <frams/genetics/preconfigured.h>
    1313
     
    5050{
    5151StdioFILE::setStdio();//setup VirtFILE::Vstdin/out/err
    52 MessageHandlerToStdout messages_to_stderr(MessageHandlerBase::Enable | MessageHandlerBase::DontBlock,VirtFILE::Vstderr); //errors -> stderr, don't interfere with stdout
     52LoggerToStdout messages_to_stderr(LoggerBase::Enable | LoggerBase::DontBlock,VirtFILE::Vstderr); //errors -> stderr, don't interfere with stdout
    5353
    5454PreconfiguredGenetics genetics;
     
    7979if (!m.isValid())
    8080        {
    81         Hprintf("","full_props",HMLV_ERROR,"Cannot build Model from the supplied genotype\n");
     81        logPrintf("","full_props",LOG_ERROR,"Cannot build Model from the supplied genotype\n");
    8282        return 2;       
    8383        }
  • cpp/frams/_demos/geno_test.cpp

    r372 r375  
    66#include <frams/util/sstringutils.h>
    77#include <frams/genetics/preconfigured.h>
    8 #include <frams/mhandlers/stdouthandler.h>
     8#include <frams/loggers/loggertostdout.h>
    99
    1010/**
     
    1818{
    1919        PreconfiguredGenetics genetics;
    20         MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable); //comment this object out to mute error/warning messages
     20        LoggerToStdout messages_to_stdout(LoggerBase::Enable); //comment this object out to mute error/warning messages
    2121
    2222        if (argc <= 1)
  • cpp/frams/_demos/genoconv_test.cpp

    r372 r375  
    99
    1010#include "printconvmap.h"
    11 #include <frams/mhandlers/stdouthandler.h>
     11#include <frams/loggers/loggertostdout.h>
    1212
    1313/**
     
    117117int main(int argc,char *argv[])
    118118{
    119 MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable);
     119LoggerToStdout messages_to_stdout(LoggerBase::Enable);
    120120
    121121DefaultGenoConvManager gcm;
  • cpp/frams/_demos/genomanipulation.cpp

    r372 r375  
    1010#include <frams/model/model.h>
    1111#include <frams/genetics/preconfigured.h>
    12 #include <frams/mhandlers/stdouthandler.h>
     12#include <frams/loggers/loggertostdout.h>
    1313
    1414/**
     
    266266int main(int argc,char*argv[])
    267267{
    268 MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable); //redirect model-related errors to stdout
     268LoggerToStdout messages_to_stdout(LoggerBase::Enable); //redirect model-related errors to stdout
    269269
    270270srand(time(0));
  • cpp/frams/_demos/genooper_test.cpp

    r372 r375  
    33// See LICENSE.txt for details.
    44
    5 #include <frams/mhandlers/stdouthandler.h>
     5#include <frams/loggers/loggertostdout.h>
    66#include <frams/genetics/preconfigured.h>
    77
     
    2121int main(int argc, char *argv[])
    2222{
    23         MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable);
     23        LoggerToStdout messages_to_stdout(LoggerBase::Enable);
    2424        PreconfiguredGenetics genetics;
    2525
  • cpp/frams/_demos/loader_test_param.cpp

    r372 r375  
    55#include <frams/param/multiparamload.h>
    66#include <frams/virtfile/stdiofile.h>
    7 #include <frams/mhandlers/stdouthandler.h>
     7#include <frams/loggers/loggertostdout.h>
    88
    99/**
     
    6666        StdioFILEDontClose virt_stderr(stderr);
    6767        StdioFILEDontClose virt_stdout(stdout);
    68         MessageHandlerToStdout messages_to_stderr(MessageHandlerBase::Enable, &virt_stderr);
     68        LoggerToStdout messages_to_stderr(LoggerBase::Enable, &virt_stderr);
    6969        StdioFileSystem_autoselect stdiofilesys;
    7070        MultiParamLoader loader(argv[1]);
  • cpp/frams/_demos/multiline_f0_test.cpp

    r372 r375  
    1010#include <frams/genetics/preconfigured.h>
    1111#include <frams/model/model.h>
    12 #include <frams/mhandlers/stdouthandler.h>
     12#include <frams/loggers/loggertostdout.h>
    1313#include <frams/virtfile/stringfile.h>
    1414
    1515int main(int argc,char*argv[])
    1616{
    17 MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable);
     17LoggerToStdout messages_to_stdout(LoggerBase::Enable);
    1818PreconfiguredGenetics genetics;
    1919
  • cpp/frams/_demos/neuro_layout_test.cpp

    r372 r375  
    77#include <frams/genetics/preconfigured.h>
    88#include <frams/model/model.h>
    9 #include <frams/mhandlers/stdouthandler.h>
     9#include <frams/loggers/loggertostdout.h>
    1010#include <frams/canvas/nn_layout_model.h>
    1111
     
    8383int main(int argc,char*argv[])
    8484{
    85 MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable);
     85LoggerToStdout messages_to_stdout(LoggerBase::Enable);
    8686PreconfiguredGenetics genetics;
    8787
  • cpp/frams/_demos/neuro_test.cpp

    r372 r375  
    99#include <frams/neuro/neuroimpl.h>
    1010#include <frams/neuro/neurofactory.h>
    11 #include <frams/mhandlers/stdouthandler.h>
     11#include <frams/loggers/loggertostdout.h>
    1212
    1313/**
     
    6060int main(int argc,char*argv[])
    6161{
    62 MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable);
     62LoggerToStdout messages_to_stdout(LoggerBase::Enable);
    6363PreconfiguredGenetics genetics;
    6464
  • cpp/frams/_demos/shapeconvert.cpp

    r372 r375  
    99
    1010#include <frams/model/model.h>
    11 #include <frams/mhandlers/stdouthandler.h>
     11#include <frams/loggers/loggertostdout.h>
    1212#include <frams/genetics/preconfigured.h>
    1313
     
    3434{
    3535        StdioFILE::setStdio();//setup VirtFILE::Vstdin/out/err
    36         MessageHandlerToStdout messages_to_stderr(MessageHandlerBase::Enable | MessageHandlerBase::DontBlock, VirtFILE::Vstderr); //errors -> stderr, don't interfere with stdout
     36        LoggerToStdout messages_to_stderr(LoggerBase::Enable | LoggerBase::DontBlock, VirtFILE::Vstderr); //errors -> stderr, don't interfere with stdout
    3737
    3838        PreconfiguredGenetics genetics;
     
    5050                                if ((shape != Part::SHAPE_ELLIPSOID) && (shape != Part::SHAPE_CUBOID) && (shape != Part::SHAPE_CYLINDER))
    5151                                {
    52                                         Hprintf("", "shapeconvert", HMLV_ERROR, "Invalid shape");
     52                                        logPrintf("", "shapeconvert", LOG_ERROR, "Invalid shape");
    5353                                        return 4;
    5454                                }
     
    7171        if (!m.isValid())
    7272        {
    73                 Hprintf("", "shapeconvert", HMLV_ERROR, "Cannot build Model from the supplied genotype");
     73                logPrintf("", "shapeconvert", LOG_ERROR, "Cannot build Model from the supplied genotype");
    7474                return 2;
    7575        }
     
    7777        if (m.getShape() != Model::SHAPE_OLD)
    7878        {
    79                 Hprintf("", "shapeconvert", HMLV_ERROR, "Only old style shapes can be converted");
     79                logPrintf("", "shapeconvert", LOG_ERROR, "Only old style shapes can be converted");
    8080                return 3;
    8181        }
  • cpp/frams/_demos/simil_test.cpp

    r372 r375  
    55
    66#include <vector>
    7 #include "frams/mhandlers/stdouthandler.h"
     7#include "frams/loggers/loggertostdout.h"
    88#include "frams/_demos/genotypeloader.h"
    99#include "frams/genetics/preconfigured.h"
     
    3939int main(int argc, char *argv[])
    4040{
    41     MessageHandlerToStdout messages_to_stdout(MessageHandlerBase::Enable);
     41    LoggerToStdout messages_to_stdout(LoggerBase::Enable);
    4242    typedef double *pDouble;
    4343    int iCurrParam = 0; // index of the currently processed parameter
Note: See TracChangeset for help on using the changeset viewer.