Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sage-logger: show log(s) each line is going to on stdout #20640

Closed
embray opened this issue May 20, 2016 · 14 comments
Closed

sage-logger: show log(s) each line is going to on stdout #20640

embray opened this issue May 20, 2016 · 14 comments

Comments

@embray
Copy link
Contributor

embray commented May 20, 2016

A minor enhancement to sage-logger that I've found incredibly helpful. Every line output to stdout is prefixed with the name(s) of the log file(s) they are being logged to.

In particular this helps sort out stdout when there are large number of make processes running in parallel. It helps to reason about what lines of output are associated with which packages. I know each package build is logged individually as well, but this still helps understand what's going on at a glance. It also helps quickly determine which log file to look at if I see something scroll past that I want to investigate further.

Component: build

Author: Erik Bray

Branch: bc0f3da

Reviewer: Volker Braun

Issue created by migration from https://trac.sagemath.org/ticket/20640

@embray embray added this to the sage-7.3 milestone May 20, 2016
@embray
Copy link
Contributor Author

embray commented May 20, 2016

Author: Erik Bray

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 20, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

c9d0d7cecho'd string should be quoted

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 20, 2016

Changed commit from 632a6b3 to c9d0d7c

@vbraun
Copy link
Member

vbraun commented May 21, 2016

Reviewer: Volker Braun

@vbraun
Copy link
Member

vbraun commented May 22, 2016

comment:4
sage -t --long src/sage/tests/cmdline.py
**********************************************************************
File "src/sage/tests/cmdline.py", line 219, in sage.tests.cmdline.test_executable
Failed example:
    print(out)
Expected:
    Found local metadata for sqlite-...
    = SQLite =
    ...
    SQLite is a software library that implements a self-contained,
    serverless, zero-configuration, transactional SQL database engine.
    ...
Got:
    [sqlite] Found local metadata for sqlite-autoconf-3130000
    [sqlite] = SQLite =
    [sqlite] 
    [sqlite] == Description ==
    [sqlite] 
    [sqlite] SQLite is a software library that implements a self-contained,
    [sqlite] serverless, zero-configuration, transactional SQL database engine.
    [sqlite] 
    [sqlite] == License ==
    [sqlite] 
    [sqlite] Public Domain
    [sqlite] 
    [sqlite] == Upstream contact ==
    [sqlite] 
    [sqlite] * http://www.sqlite.org
    [sqlite] 
    [sqlite] == Dependencies ==
    [sqlite] 
    [sqlite] * readline
    [sqlite] 
    [sqlite] == Special Update/Build Instructions ==
    [sqlite] 
    [sqlite] * Use the autoconf version of sqlite.
    <BLANKLINE>
**********************************************************************
1 item had failures:
   1 of 235 in sage.tests.cmdline.test_executable
    [234 tests, 1 failure, 70.24 s]

@embray
Copy link
Contributor Author

embray commented May 23, 2016

comment:5

Was that the only test that changed as a result? Should be easy enough to update.

@embray
Copy link
Contributor Author

embray commented May 23, 2016

comment:6

Since it seems that sage-logger is used in a few places besides just building, maybe this behavior should be enabled only via a switch.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 26, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

bc0f3daOnly prefix log messages if -p is given to sage-logger, but use this throughout the build system.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 26, 2016

Changed commit from c9d0d7c to bc0f3da

@embray
Copy link
Contributor Author

embray commented May 26, 2016

comment:8

I added an optional -p flag for applying the line prefix. This way the previous default behavior is preserved, but the -p flag is used throughout the build system where it's most useful.

@vbraun
Copy link
Member

vbraun commented May 28, 2016

Changed branch from u/embray/sage-logger to bc0f3da

@jdemeyer
Copy link

comment:12

This causes every single line in the output of make to have [install] prepended. Surely, that's not useful and we shouldn't use the -p flag for the top-level sage-logger.

@jdemeyer
Copy link

Changed commit from bc0f3da to none

@jdemeyer
Copy link

comment:13

Also: this causes leading whitespace to be dropped from the logfile, which messes up ASCII-art-style error messages from GCC for example. See #20708.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants