aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/configs
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-11-07 15:11:32 +0800
committerAaron LI <aaronly.me@outlook.com>2016-11-07 15:11:32 +0800
commit56ed0976218c90caf6b01c532c1570d44499a7aa (patch)
tree76d37acaacdfbaecb6e59dfc89d5398dca4f0133 /fg21sim/configs
parent9626c7518479d7f4a70da751dcc257e098381fd8 (diff)
downloadfg21sim-56ed0976218c90caf6b01c532c1570d44499a7aa.tar.bz2
configs: Change "logging/filemode" to boolean "logging/appendmode"
* Update the "logging" property in "manager.py" * Also add "extragalactic/clusters" to "common/components"
Diffstat (limited to 'fg21sim/configs')
-rw-r--r--fg21sim/configs/00-general.conf.spec6
-rw-r--r--fg21sim/configs/manager.py2
2 files changed, 4 insertions, 4 deletions
diff --git a/fg21sim/configs/00-general.conf.spec b/fg21sim/configs/00-general.conf.spec
index e4a603a..bb4cbc8 100644
--- a/fg21sim/configs/00-general.conf.spec
+++ b/fg21sim/configs/00-general.conf.spec
@@ -26,7 +26,7 @@ lmax = integer(min=1, default=3071)
# Diffuse Galactic free-free emission
# + galactic/snr:
# Galactic supernova remnants emission
-components = force_list(default=list("galactic/synchrotron", "galactic/freefree", "galactic/snr"))
+components = force_list(default=list("galactic/synchrotron", "galactic/freefree", "galactic/snr", "extragalactic/clusters"))
# Frequencies specification of the simulation products
@@ -116,8 +116,8 @@ datefmt = string(default="%Y-%m-%dT%H:%M:%S")
# Set the logging filename (will create a `FileHandler`)
# If set to "" (empty string), then the `FileHandler` will be disabled.
filename = string(default="")
-# Set the mode to open the above logging file (default: "append" mode)
-filemode = option("w", "a", default="a")
+# Whether append messages to the above logging file instead of overwrite
+appendmode = boolean(default=True)
# Set the stream used to initialize the `StreamHandler`
# If set to "" (empty string), then the `StreamHandler` will be disabled.
diff --git a/fg21sim/configs/manager.py b/fg21sim/configs/manager.py
index c03222d..28ff24d 100644
--- a/fg21sim/configs/manager.py
+++ b/fg21sim/configs/manager.py
@@ -486,7 +486,7 @@ class ConfigManager:
if stream:
handlers.append(StreamHandler(getattr(sys, stream)))
logfile = conf["filename"]
- filemode = conf["filemode"]
+ filemode = "a" if conf["appendmode"] else "w"
if logfile:
handlers.append(FileHandler(logfile, mode=filemode))
#