Coder Social home page Coder Social logo

Comments (13)

raphaelschaad avatar raphaelschaad commented on August 20, 2024

First, awesome that you're using CocoaLumberjack, so are we, and I'm stoked about integrating FLAnimatedImage with it.

Second to address your build issue, I think I just adding 'const' to the declaration in your code should do the trick. I've just been following the CocoaLumberjack conventions: https://github.com/CocoaLumberjack/CocoaLumberjack/blob/master/Documentation/GettingStarted.md

from flanimatedimage.

vinibaggio avatar vinibaggio commented on August 20, 2024

Interesting. We do change the log level in our codebase, but I don't know if it's ideal, and it's clearly not a FLAnimatedImage. Thanks for your response! This is a non-issue.

from flanimatedimage.

raphaelschaad avatar raphaelschaad commented on August 20, 2024

Ok, glad it works out! Please let me know how the logging (with the auto-detect logic of CocoaLumberjack in FLAnimatedImage) works for you!

Here's the relevant bit from the README:

It has fine-grained logging. By default, it uses NSLog. However, if your project uses CocoaLumberjack, it automatically can detect that and use CocoaLumberjack to send logs to the configured output.

And here's the relevant code in FLAnimatedImage (defaults to ON): https://github.com/Flipboard/FLAnimatedImage/blob/master/FLAnimatedImageDemo/FLAnimatedImage/FLAnimatedImage.h#L20

from flanimatedimage.

vinibaggio avatar vinibaggio commented on August 20, 2024

@raphaelschaad what do you think about making this:

// Logging
// If set to 0, disables integration with CocoaLumberjack Logger (only matters if CocoaLumberjack is installed).
#define FLLumberjackIntegrationEnabled 1
// If set to 1, enables NSLog logging (only matters #if DEBUG -- never for release builds).
#define FLDebugLoggingEnabled 0

this:

// Logging
// If set to 0, disables integration with CocoaLumberjack Logger (only matters if CocoaLumberjack is installed).
#ifndef FLLumberjackIntegrationEnabled
  #define FLLumberjackIntegrationEnabled 1
#endif

// If set to 1, enables NSLog logging (only matters #if DEBUG -- never for release builds).

#define FLDebugLoggingEnabled 0

from flanimatedimage.

raphaelschaad avatar raphaelschaad commented on August 20, 2024

Would the intention be that you'd define FLLumberjackIntegrationEnabled in your own code and import that header in FLAnimatedImage.h?

from flanimatedimage.

vinibaggio avatar vinibaggio commented on August 20, 2024

Yes! So we could disable that for now. Does that make sense?

from flanimatedimage.

raphaelschaad avatar raphaelschaad commented on August 20, 2024

That seems like a reasonable change. Just couple follow up questions to clarify:

  • Is it to avoid modifying FLAnimatedImage.h? The easiest way to disable would be to just toggle the '1' to a '0' yourself.
  • And if it's because you'd like to avoid modifying FLAnimatedImage.h, are you #importing the FLAnimatedImage header after you #define that in your code? How are you structuring your code so you don't need to import your header in FLAnimatedImage header (and hence change the file anyway)?
  • And finally, did you run into any issues or is the FLAnimatedImage->Lumberjack logging too noisy, that you'd want to disable it?
    Thanks!

from flanimatedimage.

vinibaggio avatar vinibaggio commented on August 20, 2024

@raphaelschaad
1- yes, we want to avoid changing files we don't own. Our Pods directory is actually ephemeral and not source controlled, so any changes we make to Pods are discarded.
2- We could define that before the import so we could toggle the feature off, or even add a GCC predefined macros via compilation flag (-D)
3- We rely on changing the loglevel on runtime, especially on testing, so our ddLogLevel is not constant, and we can't easily change that for now, sadly.

from flanimatedimage.

raphaelschaad avatar raphaelschaad commented on August 20, 2024

Ok, I think your proposed change makes sense in your case and doesn't harm. Would you want to open a PR? For consistency I think it would make sense to also wrap FLDebugLoggingEnabled into a #ifndef, would you agree?

Until your (local) change makes it into a new CocoaPods version, you can keep it -- when updating the next time it will be discarded and the new CocoaPods version will contain it (your PR).

Any ideas how we could integrate FLAnimatedImage<->CocoaLumberjack better into your logging stack? Is this even something you desire to have?

Thanks!

from flanimatedimage.

vinibaggio avatar vinibaggio commented on August 20, 2024

I am happy to open a PR for that! I wanted to get your thoughts on the issue beforehand, though :)
And I agree with the consistency!

I don't think there's a better way to intergrate FLAnimatedImage<->CocoaLumberjack -- the problem is that we use it in a way that even CocoaLumberjack doesn't support, so I don't think there's a need for that to leak into FLAnimatedImage. I think the current approach is fine.

from flanimatedimage.

raphaelschaad avatar raphaelschaad commented on August 20, 2024

Ok, let's do this change then! Could you make sure the #define is indented with 4 spaces?

And can you live with the local change for now (I'd like to avoid cutting a new CocoaPod version just for this -- there's likely more improvements coming soon for a 1.0.3)?

from flanimatedimage.

vinibaggio avatar vinibaggio commented on August 20, 2024

Yeah! I will submit as soon as possible. Thanks so much for your help and attention! :)

from flanimatedimage.

raphaelschaad avatar raphaelschaad commented on August 20, 2024

Great! :shipit:

from flanimatedimage.

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.