Modern Python logging

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ม.ค. 2025

ความคิดเห็น • 375

  • @bombase991
    @bombase991 10 หลายเดือนก่อน +16

    18:04 Leaving a note here that QueueHandler config is only available in Python 3.12, according to the logging.config docs

  • @thisoldproperty
    @thisoldproperty ปีที่แล้ว +343

    Jeans down, this is the best python logging explanation I've ever seen. Brilliant work.

    • @threeme2189
      @threeme2189 ปีที่แล้ว +40

      I will start saying jeans down instead of hands down from this day on.
      It is, jeans down, the better of the two!

    • @hammerheadcorvette4
      @hammerheadcorvette4 ปีที่แล้ว +8

      Jeans Down?!

    • @greob
      @greob ปีที่แล้ว +6

      ⁠pants down

    • @mCoding
      @mCoding  ปีที่แล้ว +33

      Agreed, we all say "jeans down" now.

    • @thomasbrunelouellet4370
      @thomasbrunelouellet4370 9 หลายเดือนก่อน

      the best ever

  • @megaing1322
    @megaing1322 ปีที่แล้ว +388

    That "include the timezone, *trust me*" has some history... xD

    • @hemerythrin
      @hemerythrin ปีที่แล้ว +59

      "If you trust your users to do that kind of thing... *silent head shake*"

    • @Jakub1989YTb
      @Jakub1989YTb ปีที่แล้ว +20

      Working with time is the worst :D *trust me*.
      HAving users in another timezone... I'd rather write them a whole separate app :D

    • @Naej7
      @Naej7 ปีที่แล้ว +37

      Don’t use timezones, put everything in UTC

    • @playerguy2
      @playerguy2 ปีที่แล้ว +8

      While I never had this issue before, the first time I hand-rolled a logging system for a small service _I was later glad I had the foresight to include the offset from UTC._

    • @playerguy2
      @playerguy2 ปีที่แล้ว +14

      ​@@hemerythrintrust users? Buddy, I don't trust myself.

  • @atrus3823
    @atrus3823 ปีที่แล้ว +169

    I’ve always found Python logging super opaque. After hours of reading and playing around, I still never really understood it. Somehow, in 20 minutes, you covered way more than I even knew was possible and it all makes so much sense now! Thank you!
    PS: Still waiting on your C++ value category video 🤞

    • @maxrinehart4177
      @maxrinehart4177 ปีที่แล้ว +14

      That why I love the old style programming youtubers, unlike the new programming influencers who react to articles and tech news.
      Mad respect for you James. ❤

    • @mCoding
      @mCoding  ปีที่แล้ว +39

      My only hesitation with value categories video is that I have to choose whether it will be slightly incorrect or slightly incomprehensible.

    • @atrus3823
      @atrus3823 ปีที่แล้ว +5

      ​@@mCoding I'll accept either 😂. It's just another topic I struggle with, and you always have a way for making things understandable 🙏

    • @heroe1486
      @heroe1486 10 หลายเดือนก่อน +1

      @@maxrinehart4177Or straight up say nonsense and are closer to instagram influencers than actual devs, like a certain "blond" one, the problem is that there are some juniors listening to them

    • @maxrinehart4177
      @maxrinehart4177 10 หลายเดือนก่อน

      @@heroe1486 it's a disease, spilled out from instathots to wannabe programmers, the problem is the huge numbers of followers who watch this nonsense that bring no value. They bring nothing of value and it's a crime they are so popular and the actual competent tech youtubers are not. Not only the blonde one but that another guy called prime, he deleted my comments and banned me for saying his react videos bring no actual values.

  • @keslauche1779
    @keslauche1779 11 หลายเดือนก่อน +49

    This channel is dangerously underrated

    • @skewty
      @skewty 6 หลายเดือนก่อน +2

      Expert level developers don't often create a lot of TH-cam content. Like StackOverflow where most solutions aren't production level good.

  • @yxh
    @yxh 11 หลายเดือนก่อน +35

    This is my favorite format of your videos so far. No memey images, just solid information with dry humor and guiding text peppered helpfully throughout. Great content as usual.

  • @alejandropinero8530
    @alejandropinero8530 ปีที่แล้ว +23

    This breakdown on the logger is truly amazing.
    One comment regarding the queue handler implementation 18:11 . This implementation only works, as is, on Python 3.12 as prior versions don't have that available for dictConfig.

    • @mCoding
      @mCoding  ปีที่แล้ว +6

      Thank you, and you are right. Users not yet on the current stable Python (3.12) may want to subclass QueueHandler, both to create the QueueListener as well as to start its thread automatically.

    • @jrat104
      @jrat104 11 หลายเดือนก่อน +2

      @@mCodingI was looking forward to using this but i am stuck at 3.9 for reasons. Now to figure out how to do this

    • @austinraney
      @austinraney 3 หลายเดือนก่อน

      @@jrat104 you could do something like:
      ```python
      import logging.config
      import logging.handlers
      class BackportedQueueHandler(logging.handlers.QueueHandler):
      def __init__(
      self,
      handlers: logging.config.ConvertingList[str],
      queue=None,
      respect_handler_level: bool = False,
      ) -> None:
      if queue is None:
      import queue as q
      queue = q.Queue()
      assert isinstance(handlers, logging.config.ConvertingList)
      self.listener = logging.handlers.QueueListener(
      queue,
      # NOTE: `logging.config.ConvertingList` converts elements by
      # calling `convert_with_key` when accessed via `__getitem__`
      *[handlers[i] for i in range(len(handlers))],
      respect_handler_level=respect_handler_level,
      )
      super().__init__(queue)
      ```

  • @djl3009
    @djl3009 ปีที่แล้ว +11

    The "complete logging picture" @02:44 is what I've been missing. Thank you!

  • @draufunddran
    @draufunddran ปีที่แล้ว +33

    Wow... every python video from you is pure Gold. I'm only aware of one "recent" async video, but maybe you could do a more detailed video on async and await in python. I and certainly thousands of others would appreciate this.
    Keep up the awesome work!

  • @Jakub1989YTb
    @Jakub1989YTb ปีที่แล้ว +12

    Thank you for this tutorial. Nothing new for me, but finally a nice comprehensive and modern approach.
    I totally agree with the statement "the tutorials are from people that are not using it". Sadly that's true for many other tutorials.

  • @ChrisJones-hv7mo
    @ChrisJones-hv7mo 11 หลายเดือนก่อน +4

    This is a great deal better than other Python logging videos and tutorials that I have seen. They might cover the basics, but miss out pretty much entirely about information you need to know when you really want to get into logging with packages, subpackages, and user libraries,
    Thanks.

  • @youtux2
    @youtux2 4 หลายเดือนก่อน +2

    I realised my "meh" feeling about dictConfig was due to ignorance and laziness! Thanks for a great, professional tutorial!

  • @69k_gold
    @69k_gold ปีที่แล้ว +3

    The reason I love this channel and learned a lot from it is, James is one of the few programming content creators that have experience. Him saying "You know what works best for you" is an ironclad example for that

  • @penguindrummaster
    @penguindrummaster ปีที่แล้ว +46

    As someone who owns a library, and rolled my own logger (in JavaScript), I appreciate the deep dive in proper logger design and methodology. I may not be able to use the examples here, but the lesson is well-received. As a self-taught developer, I missed a lot of the history in why things are written the way they are.

    • @DJStompZone
      @DJStompZone ปีที่แล้ว +13

      You own a library? Nice!
      Do you have one of those rolling ladders to get to the high-up books?

  • @SenukiQ
    @SenukiQ ปีที่แล้ว +7

    Great video on standard library logging, but one thing to add is that I can recommend using library called structlog (for structured logs as name suggests), which are very useful especially for bigger applications, where we want to aggregate, store, parse and analyze logs on the system level. Structured logs are way easier to parse, thus analyze, so I think it's nice to have this library in your Python dev toolkit.

  • @PBJYM
    @PBJYM ปีที่แล้ว +3

    I've literally been trying to understand python logging for the past few days. This is easily the best video I've come across!

  • @allyouneed247
    @allyouneed247 5 หลายเดือนก่อน +2

    As someone who’s been using print for logging, I will have to watch this a couple more times to fully understand everything 😅 First impressions is that this seems very useful, and that although comprehensive and complex to set up for the first time, some parts should be reusable. At least for smaller projects. Most of my projects are about 500 lines of code, so this would be a substantial portion of the work setting up the first time😅 Thank you for setting me on the path of proper logging 🎉

  • @Mathymagical
    @Mathymagical ปีที่แล้ว +3

    I appreciate that you emphasized that the built-in logging library is the standard. Since there are some other competitors out there, it can be a bit confusing trying to evaluate whether to use the built-in or not.
    Thank you.

  • @CaptainCsaba
    @CaptainCsaba ปีที่แล้ว +7

    Finally I understand Python logging. I really hope one day they actually create a better logging package. Every project needs logging and it should not be this difficult and outdated, especially when it comes to Python.

    • @youtubeenjoyer1743
      @youtubeenjoyer1743 ปีที่แล้ว

      Have you seen the most popular packages on pypi? It is full of libraries built with bad decisions, bad API design, bad programming practices, bad documentation. And recently it has gotten even worse, because now all code is either type hinted or not, and is written for asyncio or not. And these new async packages are going through all the same problems that were solved decades ago for the older packages. It’s a huge mess.

    • @italianphilosopher6571
      @italianphilosopher6571 11 หลายเดือนก่อน +2

      It's Java-inspired. Difficulty, unobviousness and fussiness are a feature, not a bug.

  • @VarunSeth
    @VarunSeth ปีที่แล้ว +1

    This is an incredibly valuable information. Since this is only applicable for applications and not libraries, this is not openly discussed anywhere nor available on Github. Thanks for sharing.

  • @pablofueros
    @pablofueros ปีที่แล้ว +7

    A video like this was much needed in TH-cam, thanks so much! I've learn some new things I can now work on

  • @willemvdk4886
    @willemvdk4886 ปีที่แล้ว +7

    This is a great condensed tutorial, respect! But, I do need to add that I don't really agree on the "one logger only" rule. In a lot of cases I have learned it's very valuable to seperate logging user activity from the technical logging. In a lot of applications you would want to log user activities for legal reasons and have the technical stuff for development reasons. I'm a big proponent of seperating the two. In most applications I've worked on we have a technical logger and an audit logger. They both log VERY different stuff and have different handlers and formatters. Technical stuff goes into files and sometimes email inboxes while the audit logs go into some elastic search cluster through a kafka bus just to make sure we have the persistence.

  • @jesusromero9167
    @jesusromero9167 9 หลายเดือนก่อน

    Sometimes I don't understand a word you say, not because of your videos, but for the current knowledge I have. I still enjoyed your videos 😃

  • @bertjanbakker9497
    @bertjanbakker9497 11 หลายเดือนก่อน

    Very very good. The explanation of the mental model is Gold! Finally a video that makes it simpler by showing the whole picture and what to skip instead of just showing the bare minimum which would leave you too ignorant to see both the the forrest and the trees.

  • @playea123
    @playea123 ปีที่แล้ว +25

    Loguru is straight up the best

    • @markasiala6355
      @markasiala6355 ปีที่แล้ว +1

      I recently found this as well. Great library.

    • @karserasl
      @karserasl ปีที่แล้ว +1

      Also thread safe. There isnt any reason why you shouldn't use loguru everywhere

    • @dandan-gf4jk
      @dandan-gf4jk ปีที่แล้ว +1

      lol my comment got deleted but this thread reads like those crypto scams😂

    • @marcbresson6548
      @marcbresson6548 10 หลายเดือนก่อน +3

      @@karseraslactually there is. Loguru does not support multiple loggers. There is only one.

  • @AzinFiro
    @AzinFiro ปีที่แล้ว +29

    For anyone interested in quick and dirty logging for debug purposes, there's also watchpoints, which lets you monitor any variable for changes.

    • @wchen2340
      @wchen2340 10 หลายเดือนก่อน +1

      keep talking!

    • @AzinFiro
      @AzinFiro 10 หลายเดือนก่อน

      @@wchen2340 rich.inspect()

    • @AzinFiro
      @AzinFiro 10 หลายเดือนก่อน

      @@wchen2340 Use rich inspect() instead of print().

  • @richardcoppin5332
    @richardcoppin5332 ปีที่แล้ว +2

    Added to my reference library. This is invaluable. Thank you @mCoding.

  • @kacperkwasny3848
    @kacperkwasny3848 ปีที่แล้ว

    i love you. i didnt google for logging tutorial. I just watch your videos whenever there is a new on my main page

  • @omgwtfafterparty
    @omgwtfafterparty ปีที่แล้ว

    When I started working with the logging module it seemed difficult to understand. But actually, after 2-3 hours I admired how powerful yet simple it turns out to be. Really, you plug it in and it just works.

  • @siddharthsvnit
    @siddharthsvnit 11 หลายเดือนก่อน +1

    you really have great content, and the detail in which you go to explain a concept is really appreciation worthy. thanks for these videos, they are really informative and helpful

  • @997Pancakes
    @997Pancakes 11 หลายเดือนก่อน

    This is amazing content. Very concise and thorough, and you cover the concept in much greater depth than any other sources I've come across.

  • @jeroenvermunt3372
    @jeroenvermunt3372 ปีที่แล้ว

    I cannot overstate the value of this video. I was postponing e deep dive into logging, which I would have had this video sooner!

  • @dbreakiron
    @dbreakiron ปีที่แล้ว +2

    This is, by far, the most clear and helpful explanation of Python logging I've ever seen. Thank you!

  • @RandomAlexus
    @RandomAlexus 11 หลายเดือนก่อน

    Animations are nice, but knowing that it's his hand dragging/dropping the graphics makes this intuitive to follow. Great subtlety of presentation.

  • @Lanxxe
    @Lanxxe ปีที่แล้ว

    Just introduced myself to the logging module a week back, nice coincidence you making this video

  • @DagarCoH
    @DagarCoH ปีที่แล้ว

    When I started with the current professional work, I looked into Python logging, found many people frustrated, and wrote the logger myself. Normally I am not a fan of the DIY mentality in software, but I think I saved time this way and have what I need.

  • @vasudevmenon2496
    @vasudevmenon2496 9 หลายเดือนก่อน

    I used a mix of print and logging in my application just to take quick look of what happened at a glance. Wasn't aware of json lines and queue handler. I had switched from standard json library to orjson to get considerable speedup when handling mixture of celery task uuid, objects, dates in different formats etc.
    Thanks for sharing

  • @aliwelchoo
    @aliwelchoo ปีที่แล้ว

    My team and I have recently been working with trying to get multiple loggers setup and deleting the old logs locally after some time. I'd say this is incredible timing but I'd be lying, having this massively useful video would have been even better last week! But still, thanks so much for sharing your expertise!

    • @mCoding
      @mCoding  ปีที่แล้ว +1

      Sounds like you need to hire us to do a code review! You're very welcome regardless.

    • @aliwelchoo
      @aliwelchoo ปีที่แล้ว

      Code & architecture review I'd say! I'll definitely be seeing whether we can

  • @23wojtekk
    @23wojtekk ปีที่แล้ว

    One of the best Python channels on TH-cam, great tutorial

  • @kevon217
    @kevon217 ปีที่แล้ว

    Best video on logging I’ve seen yet. Learned a lot, thanks!

  • @DhiyaIndia
    @DhiyaIndia 11 หลายเดือนก่อน

    pure gold! I been wanting to master the logging concepts for a long time now!

  • @douglasamoo-sargon5049
    @douglasamoo-sargon5049 3 หลายเดือนก่อน

    if you are experiencing an error of ValueError: Unable to configure handler 'file' when you added the file logger, ensure that you have have log folder in your current directory. Great video btw

  • @TboneIsRogue
    @TboneIsRogue 11 หลายเดือนก่อน

    This is very nice. Extremely useful for out-of-the-box best practices for Python logging. I personally use "pip install loguru" for any projects I set up for logging, since it handles a lot of things automatically and removes so much boiletplate.

  • @this-one
    @this-one ปีที่แล้ว +5

    This is some invaluable information. Thanks for the video.

    • @mCoding
      @mCoding  ปีที่แล้ว +2

      Glad you enjoyed it!

  • @hidroman1993
    @hidroman1993 ปีที่แล้ว +2

    The acting on this video is impeccable

  • @JonathanHeavyside
    @JonathanHeavyside ปีที่แล้ว

    Epic walkthrough. The standard logger has always been a bit of a black box and logs have always been a bit of an issue as my apps have grown. This is exactly what I needed.

  • @er63438
    @er63438 9 หลายเดือนก่อน

    Really great video, thank you!
    On 20:00, it's worth mentioning that the default behavior, if I'm not mistaken, is for debug/info logs to go to stderr as well which I've always found unintuitive.

    • @mCoding
      @mCoding  9 หลายเดือนก่อน +1

      Yeah, I've found that to be an unintuitive default as well. It goes against the principle of not using stderr as just an extra stream. It should really be just for errors as intended.

  • @etis398
    @etis398 ปีที่แล้ว +1

    This video is a gift from heaven 🎉 Thanks so lot for making such high quality content helping devs around the world write better code

    • @mCoding
      @mCoding  ปีที่แล้ว +1

      I appreciate your very kind praise 😅

  • @LorenzoPersichetti
    @LorenzoPersichetti ปีที่แล้ว +1

    Best python logging video ever.

  • @Vijay-Yarramsetty
    @Vijay-Yarramsetty 11 หลายเดือนก่อน

    this is geniusly explained of how to use rarely used logging

  • @MaxNeumann-k8m
    @MaxNeumann-k8m 4 หลายเดือนก่อน +1

    Thanks for the great explanation! However, it's not quite clear to me why you shouldn't use the root logger directly 6:49 when you're not using some sort of logger tree. Could anyone explain this?

  • @amazingbanter
    @amazingbanter ปีที่แล้ว

    structured logging gold. Thank you, Mr. Murphy!

  • @alexandredamiao1365
    @alexandredamiao1365 9 หลายเดือนก่อน

    I have learned a ton from this video and channel. Such high quality! Thank you!

    • @mCoding
      @mCoding  9 หลายเดือนก่อน

      You're welcome!

  • @snehotoshbanerjee1938
    @snehotoshbanerjee1938 7 วันที่ผ่านมา

    This channel is knowledge powerhouse.

  • @UTl0l
    @UTl0l 11 หลายเดือนก่อน

    Thx for a very good explanation of python logging. I've done this whole thing so many times at different companies, in different way. The queue handler was new to me however, I guess performance wasn't of that importance.
    One thing I would add is that while JSON format is great for programmatically parsing, I wouldn't say it's as human readable as colorized text. This is what I would use locally when developing and then use JSON when deployed.

  • @kotslike
    @kotslike 11 หลายเดือนก่อน

    I salute you mister for enlightening us with this video. Thank you very much!

  • @RedPsyched
    @RedPsyched ปีที่แล้ว +1

    Not me watching the video and configuring my library logging bit by bit and then seeing the note at the end for libraries LMAO. Oh well, time to delete all that code. Great video though, definitely will use these tips in my Python apps.

    • @mCoding
      @mCoding  ปีที่แล้ว +1

      Whoops lol. 🤭

  • @aeronesto
    @aeronesto 11 หลายเดือนก่อน

    Very thorough! Thank you for putting this together! Well done!

  • @slash_me
    @slash_me ปีที่แล้ว +2

    Great video, I've been using logging for a while, but I might tune my setup with what I learned just now!
    I agree that yaml is very error prone (look up "Norway problem"), but I've also come to the conclusion that JSON is good for data exchange, but not for config files.
    For config, I've started using TOML. The syntax is a mix of JSON and .ini, but it's far less error prone than yaml, it has trailing commas, comments and can be read and written programmatically without losing formatting.
    Like yaml, it wasn't included in the stdlib, but there is now an implementation in Python 3.11+

    • @D0Samp
      @D0Samp ปีที่แล้ว

      There's also JSON5 as an extension for human-writable JSON that allows such things as trailing commas in objects and lists, comments, single quote strings, hexadecimal numbers etc. For example, it's used for the configuration file of the Windows 11 terminal app.
      The JSON module in the Python library is only meant for serialization, however.

  • @Rickety3263
    @Rickety3263 ปีที่แล้ว

    You had me cracking up. This is very relevant in what I’m working on right now. Gonna create a new boilerplate

  • @sqrt4788
    @sqrt4788 ปีที่แล้ว

    Great and concise content, did not know about dictconfig yet. Thanks!
    Around 08:40 you mention the weird format str syntax. As an alternative there is the style keyword which accepts "{", then the format str can be much more like fstrings.

    • @mCoding
      @mCoding  ปีที่แล้ว

      Great tip! I do tend to stick to the json approach, though! 😉

  • @TonyHammitt
    @TonyHammitt ปีที่แล้ว

    I like to also set up probabilistic trace logging, where some (usually small) portion of the work is logged end to end, with the portion changeable at runtime. If something doesn't seem right, being able to trace 1 of 10000 events can be really handy. That takes a bit more setup in the code, but it's super useful.

  • @hiraksarma3068
    @hiraksarma3068 9 หลายเดือนก่อน

    Superb 👍this is pure value addtion, class apart from N numbers of videos showing ABC of Python endlessly.

  • @sambroderick5156
    @sambroderick5156 ปีที่แล้ว

    Excellent logging summary/best practices! Thank you so much!

  • @colinmoon8097
    @colinmoon8097 11 หลายเดือนก่อน

    Your video did set me on the right course for logging but it is far cleverer than what you showed,. PS I do watch your videos on most things as they are extremely helpful.

  • @malcolmanderson6735
    @malcolmanderson6735 8 หลายเดือนก่อน

    at the 10:48 mark I cannot get the system to write logs to file.
    I tried pulling the code from github but the main.py file is not versioned like the config files.
    I've got a few things to check, but when you are showing files in the video at 10:48 you don't show the bottom of them.
    I've found a message somewhere on the boards that indicates I may need to make sure I'm using the right logger or logging.

  • @HansStrijker
    @HansStrijker 10 หลายเดือนก่อน

    Dude... I've been using logger since.... _years_ , and I had no notion of dictConfig's existence! Fair enough, I'm a DevOps/SysOps guy, so I pretty much only use the same handlers, stdout, stderr, and systemd-journald, which makes things easy enough to knock out, but still.
    Thanks! 🙂

  • @quintencabo
    @quintencabo ปีที่แล้ว

    Woah thanks for this amazing video. I never used to know what I was doing with python logging

  • @richisgood22
    @richisgood22 10 หลายเดือนก่อน

    Wow, this was an amazing tutorial... Thank you so much for making this!

    • @mCoding
      @mCoding  10 หลายเดือนก่อน

      And thank you for watching!

  • @josipsadek4425
    @josipsadek4425 11 หลายเดือนก่อน

    Wow, this is super useful. I was looking for something like this for my setup

  • @chrishillery
    @chrishillery ปีที่แล้ว

    Amazing, comprehensive, and clear. Thank you.

  • @rembautimes8808
    @rembautimes8808 6 หลายเดือนก่อน

    Very comprehensive tutorial thanks for sharing.

  • @aaronm6675
    @aaronm6675 ปีที่แล้ว +2

    Wowwwwww, I'm immediately cloning and implementing in my app. THX🙏

    • @zyphtron
      @zyphtron ปีที่แล้ว

      What are you really cloning?

  • @joaopedrodonasolo680
    @joaopedrodonasolo680 ปีที่แล้ว

    Finished yesterday a one week long logging project. If only I had watched your video before that...

  • @jerrylu532
    @jerrylu532 ปีที่แล้ว

    thank you i finally understand it now, have been struggling with python logging since the start of my cs journey😂

  • @stevezhou184
    @stevezhou184 หลายเดือนก่อน

    I am seeking this kind video for long time. thanks for wonderful job. python is famous for worst documentation, let along millions of youtube videos.

  • @pierreriandey6103
    @pierreriandey6103 ปีที่แล้ว

    Great quality videos, as always :) Thank you for the learning (and the entertainment, to be fair)

  • @POINTS2
    @POINTS2 ปีที่แล้ว +3

    Is there anything that would be done differently for logging with pytest?

  • @aminzahedsadeghi4995
    @aminzahedsadeghi4995 หลายเดือนก่อน

    Man, thank you for such quality of content and video, peace 😎😎

  • @allyouneed247
    @allyouneed247 4 หลายเดือนก่อน

    I've noticed something confusing in the final version, where the logged messages in the terminal have the correct value for time zones while the jsonl files have +00:00. Is this intended and something I misunderstand or is this an error. I've used the original source code only changing file names.

  • @sonluuh
    @sonluuh ปีที่แล้ว

    Nice tips for the Queue Handlers! Btw, be careful with thread-safe logging if you are using multi-thread inside your application

  • @IshayahuLastov
    @IshayahuLastov ปีที่แล้ว +1

    If I shouldn't use root logger, why all configuration I should keep in root logger and not in my on?

  • @gloweye
    @gloweye ปีที่แล้ว +2

    I remember having to explicitly murder a library's own logging config, because they were logging as plain text and we wanted everything as JSON. It was very annoying until I did some involved introspection on the logging system.

    • @mCoding
      @mCoding  ปีที่แล้ว

      Haha, what a vivid depiction, I've felt that pain, too.

  • @unperrier
    @unperrier ปีที่แล้ว +1

    Thanks. One thing you could have mentionned is that a library developper could create a filter for his own logger(s).

  • @sebsafari
    @sebsafari ปีที่แล้ว

    So great to have content like this

  • @ericklopez9754
    @ericklopez9754 11 หลายเดือนก่อน +1

    Great video, can you do a video on "try except" code blocks; I believe its blurry for a lot of people who aren't working in the industry as far as HOW to use it in your coding project. For example, do you apply it to all of your code logic ? or conservatively ? An in-depth explanation and examples when you're working in industry and you're writing code how exactly would you apply it?, whats your thinking framework with it ??? Thank you very much for the quality content.

  • @jobjitdip6161
    @jobjitdip6161 ปีที่แล้ว

    Absolutely stellar work. Thank you!

  • @TotallyFred
    @TotallyFred ปีที่แล้ว

    Best. Explanation. Ever.
    Thank you.

    • @mCoding
      @mCoding  ปีที่แล้ว

      You're very welcome!

  • @christopheroverbeck3662
    @christopheroverbeck3662 8 หลายเดือนก่อน +1

    How do we feel about sqlite logs?

  • @tylernardone3788
    @tylernardone3788 หลายเดือนก่อน

    Does the QueueHandler need to passed a queue object after loaded from the config?

  • @travelchimps6637
    @travelchimps6637 10 หลายเดือนก่อน +1

    At 19.09 where is queue.handler initialised?

  • @Caelan-u1p
    @Caelan-u1p 2 หลายเดือนก่อน

    The QueueHandler section seems to be outdated it no longer accepts a list of handlers, I can't find any information on the new way to use it though

  • @efmece
    @efmece 6 หลายเดือนก่อน

    Your video teach me a lot about logging in python😊. Thank you for this video!!
    Will you ever make of how to logging in a library?

  • @ytjho
    @ytjho 10 หลายเดือนก่อน

    That deadpan headshake at 10:31 was great 😂

  • @6f6e69
    @6f6e69 10 หลายเดือนก่อน

    Pure gold.
    Thank you, sir!

    • @mCoding
      @mCoding  10 หลายเดือนก่อน

      Much appreciated!

  • @YanKuang
    @YanKuang 10 หลายเดือนก่อน

    one question i have is that if we want to create our own custom class with this setup is it possible? i tried using a custom class and call the `dictConfig` on `__init__` method, but doesn't seem to be working? any insight or suggestions?

  • @kervinsingh6213
    @kervinsingh6213 9 หลายเดือนก่อน

    Hi, what does override do at 16:33 ? from your code, you used "from typing import override". I would've assumed you were overriding the class method but this doesn't seem to be the case.

  • @robotnaoborot
    @robotnaoborot 11 หลายเดือนก่อน

    Yeah as many mentioned I just use loguru too. It makes it really simpler without all the boilerplate which I couldn't remember even after years of using logging

  • @Ca1vema
    @Ca1vema 11 หลายเดือนก่อน

    The most basic concepts of python logging module people don't understand is that configuration of logging itself must be done by the end user, not frameworks or libraries, all what they suppose to do is to import logging, get logger and do logging calls.

  • @crazyturk909
    @crazyturk909 7 หลายเดือนก่อน

    With atexit.register(queue_handler.listener.stop) my tests are stucked and can not run. Why?