Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to disable logging #151

Closed
shawn736 opened this issue Apr 25, 2019 · 4 comments · Fixed by #1352
Closed

option to disable logging #151

shawn736 opened this issue Apr 25, 2019 · 4 comments · Fixed by #1352

Comments

@shawn736
Copy link

Please don't use NSLog in iOS to print information, or a switch is needed. For example :
NSLog(@"iOS => call %@, playerId %@", call.method, playerId);

@luanpotter
Copy link
Member

I think we should remove all logs from both android and ios, there used to be an issue about that. We'd be glad if you could contribute with a PR, @shawn736 .

@luanpotter
Copy link
Member

I think the disableLogs dart method should notify both backends via a channel to stop all logs. Then on ios introduce an if statement in the log function (just like that dart side does). For android, apart from that, we need to configure the MediaPlayer class to stop with the random logging.

It should be a relatively easy improvement if someone is interested in helping out :)

@erickzanardo
Copy link
Member

@luanpotter did this got fixed when the refactor to swift was made?

@luanpotter
Copy link
Member

Not yet, I made a refactor to allow it but didn't wire yet.

@Gustl22 Gustl22 changed the title NSLog used in iOS option to disable logging Aug 23, 2022
@Gustl22 Gustl22 mentioned this issue Jan 11, 2023
7 tasks
Gustl22 added a commit that referenced this issue Apr 4, 2023
# Description

- Replace Platform Method Channels (from platform -> to lib) with Event Channels
- Combined Event stream for player (`PlayerEvent`) and global
(`GlobalEvent`) events
- Add methods `create`, `dispose` and `getEventStream` to
`AudioplayersPlatformInterface`
- Add method `getGlobalEventStream` to
`GlobalAudioplayersPlatformInterface`
- Add log stream `player.onLog()` and `AudioPlayer.global.onLog()`
- Example for using Logger
- Throw PlatformException on Method Error via Method Channel (lib ->
platform)
- Emit PlatformException on Event Error via Event Channel (platform ->
lib) `player.eventStream.listen().onError()` and
`AudioPlayer.global.eventStream.listen().onError()`
- Add docs

## Breaking Change

### Migration instructions

**audioplayers**:
| Before | After |
|---|---|
| deprecated `AudioPlayer.global.changeLogLevel(LogLevel.info)` |
`Logger.logLevel = LogLevel.info` |
| deprecated `AudioPlayer.global.logLevel` | `Logger.logLevel` |
| deprecated `AudioPlayer.global.log()` | `Logger.log()` or
`Logger.error()` |
| deprecated `AudioPlayer.global.info()` | `Logger.log()` |
| deprecated `AudioPlayer.global.error()` | `Logger.error()` |
| `ForPlayer<>` | _removed_ |

**audioplayers_platform_interface**:
| Before | After |
|---|---|
| `LogLevel` | _moved_ to `audioplayers` package |
| `StreamsInterface` | _removed_ |
| `ForPlayer<>` | _removed_ |

## Related Issues

Closes #106
Closes #151
Closes #1266
Can handle error of #1260
Related to #208 and #933, but cannot hide Android MediaPlayer logs

This would bypass: flutter/flutter#69103
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants