Changeset 19455 for trunk/FACT++


Ignore:
Timestamp:
03/28/19 20:55:43 (6 years ago)
Author:
tbretz
Message:
I directly split now filog lename and log path into the two resources, this is more transparent for the user.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Main.h

    r19411 r19455  
    2525    void SetupConfiguration(Configuration &conf)
    2626    {
    27         const string n = conf.GetName()+".log";
     27        const auto n = fs::path(conf.GetName()+".log");
    2828
    2929        po::options_description config("Program options");
     
    3232            ("port",       var<uint16_t>(DNS_PORT),  "Port to connect to dim nameserver.")
    3333            ("host",       var<string>(""),          "Address with which the Dim nameserver can connect to this host (overwites DIM_HOST_NODE environment variable)")
    34             ("log,l",      var<string>(n), "Name of local log-file")
    35             ("logpath",    var<string>(),  "Absolute path to log-files (default: excutable's directory)")
     34            ("log,l",      var<string>(n.filename().string()), "Name of local log-file")
     35            ("logpath",    var<string>(n.parent_path().string()),  "Path to log-files")
    3636            ("no-log",     po_switch(),    "Supress log-file")
    3737            ("append-log", po_bool(),      "Append log information to local log-file")
     
    156156            const fs::path file = fs::path(conf.Get<string>("log")).filename();
    157157#endif
     158            cerr << "Writing logfile to '" << (path/file).string() << endl;
     159
    158160            if (!wout.OpenLogFile((path/file).string(), conf.Get<bool>("append-log")))
    159161                win << kYellow << "WARNING - Couldn't open log-file " << (path/file).string() << ": " << strerror(errno) << endl;
Note: See TracChangeset for help on using the changeset viewer.