How to use the logzero.logger.level function in logzero

To help you get started, we’ve selected a few logzero examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thebigmunch / google-music-scripts / src / google_music_scripts / commands / upload.py View on Github external
sys.exit("Failed to authenticate client.")

	if no_recursion:
		max_depth = 0
	elif max_depth is None:
		max_depth = float('inf')

	to_upload = get_local_songs(input_paths, filters=filters, max_depth=max_depth)
	to_upload.sort()

	if not to_upload:
		logger.info("No songs to upload")
	elif dry_run:
		logger.info(f"Found {len(to_upload)} songs to upload")

		if logger.level <= 10:
			for song in to_upload:
				logger.debug(song)
	else:
		upload_songs(
			mm,
			to_upload,
			album_art=album_art,
			no_sample=no_sample,
			delete_on_success=delete_on_success
		)

	mm.logout()
	logger.info("All done!")
github thebigmunch / google-music-scripts / src / google_music_scripts / commands / download.py View on Github external
to_download = filter_songs(mm.songs(), filters)
	to_download.sort(
		key=lambda song: (
			song.get('artist', ''),
			song.get('album', ''),
			song.get('track_number', 0)
		)
	)

	if not to_download:
		logger.info("No songs to download")
	elif dry_run:
		logger.info(f"Found {len(to_download)} songs to download")

		if logger.level <= 10:
			for song in to_download:
				title = song.get('title', "<title>")
				artist = song.get('artist', "&lt;artist&gt;")
				album = song.get('album', "&lt;album&gt;")
				song_id = song['id']

				logger.debug(f"{title} -- {artist} -- {album} ({song_id})")
	else:
		download_songs(mm, to_download, template=output)

	mm.logout()
	logger.info("All done!")
</title>
github ritiek / spotify-downloader / spotdl / convert.py View on Github external
def with_ffmpeg(self, trim_silence=False):
        ffmpeg_pre = (
            "ffmpeg -y -nostdin "
        )  # -nostdin is necessary for spotdl to be able to run in the backgroung.

        if not log.level == 10:
            ffmpeg_pre += "-hide_banner -nostats -v panic "

        ffmpeg_params = ""

        if self.input_ext == ".m4a":
            if self.output_ext == ".mp3":
                ffmpeg_params = "-codec:v copy -codec:a libmp3lame -ar 44100 "
            elif self.output_ext == ".webm":
                ffmpeg_params = "-codec:a libopus -vbr on "
            elif self.output_ext == ".m4a":
                ffmpeg_params = "-acodec copy "

        elif self.input_ext == ".webm":
            if self.output_ext == ".mp3":
                ffmpeg_params = "-codec:a libmp3lame -ar 44100 "
            elif self.output_ext == ".m4a":
github thebigmunch / google-music-scripts / src / google_music_scripts / commands / sync.py View on Github external
logger.info("Comparing song collections")
	to_upload = sorted(
		gm_utils.find_missing_items(
			local_songs,
			google_songs,
			fields=['artist', 'album', 'title', 'tracknumber'],
			normalize_values=True
		)
	)

	if not to_upload:
		logger.info("No songs to upload")
	elif dry_run:
		logger.info(f"Found {len(to_upload)} songs to upload")

		if logger.level &lt;= 10:
			for song in to_upload:
				logger.debug(song)
	else:
		upload_songs(
			mm,
			to_upload,
			album_art=album_art,
			no_sample=no_sample,
			delete_on_success=delete_on_success
		)

	mm.logout()
	logger.info("All done!")