Code Monkey home page Code Monkey logo

Comments (4)

thekix avatar thekix commented on June 29, 2024

Dear @hvhaugwitz,

Thanks a lot for your report. Please, could you try this? Apply this patch (or modify this line) in the file offlineimap/ui/UIBase.py:

diff --git a/offlineimap/ui/UIBase.py b/offlineimap/ui/UIBase.py
index d49d564..412d22a 100644
--- a/offlineimap/ui/UIBase.py
+++ b/offlineimap/ui/UIBase.py
@@ -99,7 +99,7 @@ class UIBase:
         # create syslog handler
         ch = logging.handlers.SysLogHandler('/dev/log')
         # create formatter and add it to the handlers
-        self.formatter = logging.Formatter("%(message)s")
+        self.formatter = logging.Formatter("OfflineIMAP[%(process)d]: %(message)s")
         ch.setFormatter(self.formatter)
         # add the handlers to the logger
         self.logger.addHandler(ch)

Then, the syslog output should be something like:

Oct 11 21:55:10 yangon OfflineIMAP[635798]: Syncing &APEA5A-: IMAP -> Maildir
Oct 11 21:55:10 yangon OfflineIMAP[635798]: Syncing &APEA8QDxAOQA5ADk-: IMAP -> Maildir
Oct 11 21:55:10 yangon OfflineIMAP[635798]: Syncing abc@AA: IMAP -> Maildir
Oct 11 21:55:10 yangon OfflineIMAP[635798]: Syncing foo: IMAP -> Maildir
Oct 11 21:55:10 yangon OfflineIMAP[635798]: Syncing foo bar: IMAP -> Maildir
Oct 11 21:55:10 yangon OfflineIMAP[635798]: Syncing INBOX: IMAP -> Maildir
Oct 11 21:55:10 yangon OfflineIMAP[635798]: Syncing Nueva Carpeta: IMAP -> Maildir
Oct 11 21:55:10 yangon OfflineIMAP[635798]: Syncing Trash: IMAP -> Maildir

If it is OK for you, I will provide a new patch. Feel free to create it if you want.

Best regards,
kix

from offlineimap3.

hvhaugwitz avatar hvhaugwitz commented on June 29, 2024

Thanks, looks good to me (though I personally would prefer a lower-case only tag).

I also applied the patch to Noninteractive.py, so that the change is also visible when using -u syslog.

from offlineimap3.

thekix avatar thekix commented on June 29, 2024

Thansk @hvhaugwitz,

please, could you send the changes in Noninteractive.py to see them?

would you like send the patch?

Best regards,
kix

from offlineimap3.

hvhaugwitz avatar hvhaugwitz commented on June 29, 2024
diff --git a/offlineimap/ui/Noninteractive.py b/offlineimap/ui/Noninteractive.py
--- a/offlineimap/ui/Noninteractive.py
+++ b/offlineimap/ui/Noninteractive.py
@@ -45,7 +45,7 @@ class Syslog:
         # create syslog handler
         ch = logging.handlers.SysLogHandler('/dev/log')
         # create formatter and add it to the handlers
-        self.formatter = logging.Formatter("%(message)s")
+        self.formatter = logging.Formatter("offlineimap[%(process)d]: %(message)s")
         ch.setFormatter(self.formatter)
         # add the handlers to the logger
         self.logger.addHandler(ch)
diff --git a/offlineimap/ui/UIBase.py b/offlineimap/ui/UIBase.py
--- a/offlineimap/ui/UIBase.py
+++ b/offlineimap/ui/UIBase.py
@@ -99,7 +99,7 @@ class UIBase:
         # create syslog handler
         ch = logging.handlers.SysLogHandler('/dev/log')
         # create formatter and add it to the handlers
-        self.formatter = logging.Formatter("%(message)s")
+        self.formatter = logging.Formatter("offlineimap[%(process)d]: %(message)s")
         ch.setFormatter(self.formatter)
         # add the handlers to the logger
         self.logger.addHandler(ch)

from offlineimap3.

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.