@@ -96,7 +96,7 @@
Loading
96 96
    port: int = Field(7777, description="The QCFractal default port.")
97 97
98 98
    compress_response: bool = Field(
99 -
        True, description="Compress REST responses or not, should be True unless behind a " "proxy."
99 +
        True, description="Compress REST responses or not, should be True unless behind a proxy."
100 100
    )
101 101
    allow_read: bool = Field(True, description="Always allows read access to record tables.")
102 102
    security: str = Field(
@@ -109,6 +109,7 @@
Loading
109 109
110 110
    query_limit: int = Field(1000, description="The maximum number of records to return per query.")
111 111
    logfile: Optional[str] = Field("qcfractal_server.log", description="The logfile to write server logs.")
112 +
    loglevel: str = Field("info", description="Level of logging to enable (debug, info, warning, error, critical)")
112 113
    service_frequency: int = Field(60, description="The frequency to update the QCFractal services.")
113 114
    max_active_services: int = Field(20, description="The maximum number of concurrent active services.")
114 115
    heartbeat_frequency: int = Field(1800, description="The frequency (in seconds) to check the heartbeat of workers.")

@@ -34,8 +34,6 @@
Loading
34 34
    WavefunctionStoreHandler,
35 35
)
36 36
37 -
myFormatter = logging.Formatter("[%(asctime)s] %(message)s", datefmt="%m/%d/%Y %I:%M:%S %p")
38 -
39 37
40 38
def _build_ssl():
41 39
    from cryptography import x509
@@ -109,6 +107,7 @@
Loading
109 107
        view_path: Optional[str] = None,
110 108
        # Log options
111 109
        logfile_prefix: str = None,
110 +
        loglevel: str = "info",
112 111
        log_apis: bool = False,
113 112
        geo_file_path: str = None,
114 113
        # Queue options
@@ -148,6 +147,8 @@
Loading
148 147
            The maximum number of entries a query will return.
149 148
        logfile_prefix : str, optional
150 149
            The logfile to use for logging.
150 +
        loglevel : str, optional
151 +
            The level of logging to output
151 152
        queue_socket : BaseAdapter, optional
152 153
            An optional Adapter to provide for server to have limited local compute.
153 154
            Should only be used for testing and interactive sessions.
@@ -177,6 +178,7 @@
Loading
177 178
178 179
        tornado.log.enable_pretty_logging()
179 180
        self.logger = logging.getLogger("tornado.application")
181 +
        self.logger.setLevel(loglevel.upper())
180 182
181 183
        # Create API Access logger class if enables
182 184
        if log_apis:

@@ -76,9 +76,9 @@
Loading
76 76
    start = subparsers.add_parser("start", help="Starts a QCFractal server instance.")
77 77
    start.add_argument("--base-folder", **FractalConfig.help_info("base_folder"))
78 78
79 -
    # Allow port and logfile to be altered on the fly
79 +
    # Allow some config settings to be altered via the command line
80 80
    fractal_args = start.add_argument_group("Server Settings")
81 -
    for field in ["port", "logfile"]:
81 +
    for field in ["port", "logfile", "loglevel"]:
82 82
        cli_name = "--" + field.replace("_", "-")
83 83
        fractal_args.add_argument(cli_name, **FractalServerSettings.help_info(field))
84 84
@@ -322,8 +322,8 @@
Loading
322 322
    # check if db not current, ask for upgrade
323 323
324 324
    print("Starting a QCFractal server.\n")
325 -
326 325
    print(f"QCFractal server base folder: {config.base_folder}")
326 +
327 327
    # Build an optional adapter
328 328
    if args["local_manager"]:
329 329
        ncores = args["local_manager"]
@@ -359,6 +359,9 @@
Loading
359 359
    else:
360 360
        logfile = str(config.base_path / config.fractal.logfile)
361 361
362 +
    print("\n>>> Logging to " + logfile)
363 +
    print(">>> Loglevel: " + config.fractal.loglevel.upper())
364 +
362 365
    print("\n>>> Checking the PostgreSQL connection...")
363 366
    psql = PostgresHarness(config, quiet=False, logger=print)
364 367
@@ -386,6 +389,7 @@
Loading
386 389
            view_path=config.view_path,
387 390
            # Log options
388 391
            logfile_prefix=logfile,
392 +
            loglevel=config.fractal.loglevel,
389 393
            log_apis=config.fractal.log_apis,
390 394
            geo_file_path=config.geo_file_path(),
391 395
            # Queue options
@@ -578,11 +582,16 @@
Loading
578 582
            sys.exit(1)
579 583
580 584
        file_dict = FractalConfig(**yaml.load(config.config_file_path.read_text(), Loader=yaml.FullLoader)).dict()
581 -
        config_dict = config.dict(skip_defaults=True)
585 +
        config_dict = config.dict(exclude_unset=True)
582 586
583 587
        # Only fractal options can be changed by user input parameters
584 588
        file_dict["fractal"] = {**file_dict.pop("fractal"), **config_dict.pop("fractal")}
585 589
590 +
        # base_folder is global (outside of fractal, database, etc).
591 +
        # Should be included here, just for debugging and printing purposes (as its only purpose
592 +
        # was to read the config_file above)
593 +
        file_dict["base_folder"] = config.base_folder
594 +
586 595
        config = FractalConfig(**file_dict)
587 596
588 597
    if command == "init":
Files Coverage
qcfractal 88.17%
Project Totals (67 files) 88.17%
1844.1
TRAVIS_OS_NAME=linux
1844.2
TRAVIS_OS_NAME=linux
1844.3
TRAVIS_OS_NAME=linux
1844.4
TRAVIS_OS_NAME=linux
1
coverage:
2
  ignore:
3
    - */tests/*
4
    - qcfractal/dashboard/* # early state
5
    - qcfractal/alembic/* # difficult to test
6
    - qcfractal/_version.py
7
    - setup.py
8
  status:
9
    patch: false
10
    project:
11
      default:
12
        threshold: 80%
13
comment:
14
  layout: "header"
15
  require_changes: false
16
  branches: null
17
  behavior: once
18
  flags: null
19
  paths: null
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading