Skip to content

Commit

Permalink
Merge pull request #685 from ratt-ru/jason-logicide
Browse files Browse the repository at this point in the history
Jason's LogMustFall
  • Loading branch information
o-smirnov authored Oct 22, 2020
2 parents 8631e38 + 5b702fb commit d0dd78f
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 354 deletions.
3 changes: 0 additions & 3 deletions bin/stimela
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,4 @@ import stimela.main as main

# Ensure that logging infrastructure exists

if not os.path.exists(stimela.LOG_HOME):
os.mkdir(stimela.LOG_HOME)

main.main([a for a in sys.argv[1:]])
6 changes: 0 additions & 6 deletions stimela/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
CAB_PATH = os.path.join(root, "cargo/cab")
BASE_PATH = os.path.join(root, "cargo/base")

# Set up logging infrastructure
LOG_HOME = os.path.expanduser("~/.stimela")
# make sure directory exists
Path(LOG_HOME).mkdir(exist_ok=True)
# This is is the default log file. It logs stimela images, containers and processes
LOG_FILE = "{0:s}/stimela_logfile.json".format(LOG_HOME)

GLOBALS = {'foo': 'bar'}
del GLOBALS['foo']
Expand Down
7 changes: 0 additions & 7 deletions stimela/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ def __init__(self, image, name,
self.PID = os.getpid()
self.uptime = "00:00:00"
self.time_out = time_out
self.cont_logger = utils.logger.StimelaLogger(
log_container or stimela.LOG_FILE, jtype="docker")

def add_volume(self, host, container, perm="rw", noverify=False):

Expand Down Expand Up @@ -160,8 +158,6 @@ def start(self, output_wrangler=None):
tstart = time.time()
self.status = "running"

self.cont_logger.log_container(self.name)
self.cont_logger.write()
self._print("Starting container [{0:s}]. Timeout set to {1:d}. The container ID is printed below.".format(
self.name, self.time_out))
utils.xrun("docker", ["start", "-a", self.name],
Expand Down Expand Up @@ -220,9 +216,6 @@ def remove(self):
raise DockerError(
"Container [{}] has not been stopped, cannot remove".format(self.name))

self.cont_logger.remove('containers', self.name)
self.cont_logger.write()

def _print(self, message):
if self.logger:
self.logger.info(message)
Expand Down
Loading

0 comments on commit d0dd78f

Please sign in to comment.