GithubHelp home page GithubHelp logo

Comments (6)

minrk avatar minrk commented on July 20, 2024

I don't know what more robust means in this case. What exactly do you want it to do?

from ipyparallel.

mccarthyryanc avatar mccarthyryanc commented on July 20, 2024

I guess what I was looking for was something that extended the Logger class from the logging package so I could get logging messages from engines with something like:

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()

def func(logger):
    logger.debug("hostname: %s", socket.gethostname())
    logger.warning("hostname: %s", socket.gethostname())

c = Client()
dv = c[:]
dv.apply_async(func,range(10),{'logger':logger})

Right now I just capture stdout from the engines in a similar manner to what's done in iopubwatcher.py. Perhaps that isn't the best method for logging, though.

from ipyparallel.

grantstephens avatar grantstephens commented on July 20, 2024

Did you manage to get something working with the logger class?
Ran into a similar problem and it works in multiprocessing, but not ipyparallel.

from ipyparallel.

mccarthyryanc avatar mccarthyryanc commented on July 20, 2024

@RexFuzzle I didn't get a logger class working. What I am doing now is basically running main from iopubwatcher.py with multiprocessing.Process and writing output to a file instead of stdout.

from ipyparallel.

DrSAR avatar DrSAR commented on July 20, 2024

I'm not going to pretend I understand what is going on here but in the [logging cookbook](git push --set-upstream origin logging.remastered) there is mention of a ZeroMQ ‘publish’ socket in conjunction with a ZeroMQ ‘subscribe’ socket. Maybe that's the the way to pass your engine produced log chatter back to the hub?

from ipyparallel.

minrk avatar minrk commented on July 20, 2024

Hi! I’m going through and cleaning up old/stale issues on this repo. I’m especially closing old “how to” or debugging questions to keep the Issues list to bug reports and feature requests. These can be directed to the Jupyter forum if still relevant.

The 'modern' Jupyter approach I'd use for logging special messages is to use displaypub with custom mimetypes, which you can then watch for like the iopub watcher:

from IPython.display import publish_display_data
publish_display_data({"text/x-my-log": "log-message"})

from ipyparallel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.