Comments (13)
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.
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.
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.
@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.
Would the intention be that you'd define FLLumberjackIntegrationEnabled
in your own code and import that header in FLAnimatedImage.h
?
from flanimatedimage.
Yes! So we could disable that for now. Does that make sense?
from flanimatedimage.
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.
@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.
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.
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.
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.
Yeah! I will submit as soon as possible. Thanks so much for your help and attention! :)
from flanimatedimage.
Great!
from flanimatedimage.
Related Issues (20)
- Bug Report HOT 1
- the image can not be displayed for ios 14. HOT 2
- Adding as SPM package issue
- Single-frame GIF has rendering issues on iOS 14 HOT 2
- 播放速度秒数对不上问题 HOT 3
- Hardcoded Frame Rate Divisor HOT 3
- loopCompletionBlock does not work HOT 1
- 在iPhone13Promax播放帧率异常加快 HOT 5
- iPhone 偶尔 crash , ios14.8 or iOS 15.0,FLAnimatedImage initWithAnimatedGIFData:optimalFrameCacheSize:predrawingEnabled:]
- 在iPhone13 promax播放GiF图异常问题修复后,非GIF图片不能正常显示。 HOT 1
- 播放速度过慢如何调整 HOT 2
- Bitcode not enabled for package
- Hi, is there the latest version released? HOT 2
- why do i can't pod search FLAnimatedImage 1.0.17 HOT 2
- Crash in imageAtIndex
- How do i stream a gif so that it plays like it would in the browser
- FLAnimatedImage
- Xcode 14.3 Support
- Feature Request: Support App Privacy Manifest HOT 1
- Upload Privacy Policy HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flanimatedimage.