Repository: ManimCommunity/manim

Issue:
`set_background_from_func` leads to errors with `logger.info`
## Description of bug / unexpected behavior
<!-- Add a clear and concise description of the problem you encountered. -->
Basically, I want the top of the background to start with one color and then have it fade to black in the center and then fade back to the same color at the bottom (see the code used in a later section).

The problem is that this code leads to errors associated with `logger.info` (see terminal output in later section).  Downloading the most recent source code and commenting out the `logger.info` lines fixed that error.  So it appears as though there is something wrong with `logger.info` in Manim.

## Expected behavior
<!-- Add a clear and concise description of what you expected to happen. -->
Setting the background should not lead to errors.  Either the `logger.info` functionality is not working, or it should be removed from this function.

## How to reproduce the issue
<!-- Provide a piece of code illustrating the undesired behavior. -->

<details><summary>Code for reproducing the problem</summary>

```py
self.camera.set_background_from_func(
                lambda point: interpolate_color(
                    '#99CCFF',                                                                          
                    '#000000',                                         
                    np.abs(point)[0]/(config.frame_height)/2)   
                )
```

</details>


## Logs
<details><summary>Terminal output</summary>
<!-- Add "-v DEBUG" when calling manim to generate more detailed logs -->

```
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│                                                                                                  │
│ /home/alexlembcke/.local/lib/python3.9/site-packages/manim/cli/render/commands.py:139 in render  │
│                                                                                                  │
│   136 │   │   for SceneClass in scene_classes_from_file(file):                                   │
│   137 │   │   │   try:                                                                           │
│   138 │   │   │   │   scene = SceneClass()                                                       │
│ ❱ 139 │   │   │   │   scene.render()                                                             │
│   140 │   │   │   except Exception:                                                              │
│   141 │   │   │   │   error_console.print_exception()                                            │
│   142 │   │   │   │   sys.exit(1)                                                                │
│ /home/alexlembcke/.local/lib/python3.9/site-packages/manim/scene/scene.py:219 in render          │
│                                                                                                  │
│    216 │   │   """                                                                               │
│    217 │   │   self.setup()                                                                      │
│    218 │   │   try:                                                                              │
│ ❱  219 │   │   │   self.construct()                                                              │
│    220 │   │   except EndSceneEarlyException:                                                    │
│    221 │   │   │   pass                                                                          │
│    222 │   │   except RerunSceneException as e:                                                  │
│                                                                                                  │
│ /home/alexlembcke/VolSight/blueprint.py:24 in construct                                          │
│                                                                                                  │
│   21 class Test(ThreeDScene):                                                                    │
│   22 │   def construct(self):                                                                    │
│   23 │   │   #self.camera.background_color='#003153'                                             │
│ ❱ 24 │   │   self.camera.set_background_from_func(                                               │
│   25 │   │   │   │   lambda point: interpolate_color('#99CCFF', '#000000', np.absolute(point)    │
│   26 │   │   │   │   )                                                                           │
│   27                                                                                             │
│                                                                                                  │
│ /home/alexlembcke/.local/lib/python3.9/site-packages/manim/camera/camera.py:381 in               │
│ set_background_from_func                                                                         │
│                                                                                                  │
│    378 │   │   │   The function whose input is an (x,y) pair of coordinates and                  │
│    379 │   │   │   whose return values must be the colors for that point                         │
│    380 │   │   """                                                                               │
│ ❱  381 │   │   self.set_background(self.make_background_from_func(coords_to_colors_func))        │
│    382 │                                                                                         │
│    383 │   def reset(self):                                                                      │
│    384 │   │   """Resets the camera's pixel array                                                │
│                                                                                                  │
│ /home/alexlembcke/.local/lib/python3.9/site-packages/manim/camera/camera.py:356 in               │
│ make_background_from_func                                                                        │
│                                                                                                  │
│    353 │   │   │   The pixel array which can then be passed to set_background.                   │
│    354 │   │   """                                                                               │
│    355 │   │                                                                                     │
│ ❱  356 │   │   logger.info(                                                                      │
│    357 │   │   │   "Starting set_background; for reference, the current time is ",               │
│    358 │   │   │   time.strftime("%H:%M:%S"),                                                    │
│    359 │   │   )                                                                                 │
│                                                                                                  │
│ /usr/lib/python3.9/logging/__init__.py:1446 in info                                              │
│                                                                                                  │
│   1443 │   │   logger.info("Houston, we have a %s", "interesting problem", exc_info=1)           │
│   1444 │   │   """                                                                               │
│   1445 │   │   if self.isEnabledFor(INFO):                                                       │
│ ❱ 1446 │   │   │   self._log(INFO, msg, args, **kwargs)                                          │
│   1447 │                                                                                         │
│   1448 │   def warning(self, msg, *args, **kwargs):                                              │
│   1449 │   │   """                                                                               │
│                                                                                                  │
│ /usr/lib/python3.9/logging/__init__.py:1589 in _log                                              │
│                                                                                                  │
│   1586 │   │   │   │   exc_info = sys.exc_info()                                                 │
│   1587 │   │   record = self.makeRecord(self.name, level, fn, lno, msg, args,                    │
│   1588 │   │   │   │   │   │   │   │    exc_info, func, extra, sinfo)                            │
│ ❱ 1589 │   │   self.handle(record)                                                               │
│   1590 │                                                                                         │
│   1591 │   def handle(self, record):                                                             │
│   1592 │   │   """                                                                               │
│                                                                                                  │
│ /usr/lib/python3.9/logging/__init__.py:1599 in handle                                            │
│                                                                                                  │
│   1596 │   │   well as those created locally. Logger-level filtering is applied.                 │
│   1597 │   │   """                                                                               │
│   1598 │   │   if (not self.disabled) and self.filter(record):                                   │
│ ❱ 1599 │   │   │   self.callHandlers(record)                                                     │
│   1600 │                                                                                         │
│   1601 │   def addHandler(self, hdlr):                                                           │
│   1602 │   │   """                                                                               │
│                                                                                                  │
│ /usr/lib/python3.9/logging/__init__.py:1661 in callHandlers                                      │
│                                                                                                  │
│   1658 │   │   │   for hdlr in c.handlers:                                                       │
│   1659 │   │   │   │   found = found + 1                                                         │
│   1660 │   │   │   │   if record.levelno >= hdlr.level:                                          │
│ ❱ 1661 │   │   │   │   │   hdlr.handle(record)                                                   │
│   1662 │   │   │   if not c.propagate:                                                           │
│   1663 │   │   │   │   c = None    #break out                                                    │
│   1664 │   │   │   else:                                                                         │
│                                                                                                  │
│ /usr/lib/python3.9/logging/__init__.py:952 in handle                                             │
│                                                                                                  │
│    949 │   │   if rv:                                                                            │
│    950 │   │   │   self.acquire()                                                                │
│    951 │   │   │   try:                                                                          │
│ ❱  952 │   │   │   │   self.emit(record)                                                         │
│    953 │   │   │   finally:                                                                      │
│    954 │   │   │   │   self.release()                                                            │
│    955 │   │   return rv                                                                         │
│                                                                                                  │
│ /home/alexlembcke/.local/lib/python3.9/site-packages/rich/logging.py:119 in emit                 │
│                                                                                                  │
│   116 │                                                                                          │
│   117 │   def emit(self, record: LogRecord) -> None:                                             │
│   118 │   │   """Invoked by logging."""                                                          │
│ ❱ 119 │   │   message = self.format(record)                                                      │
│   120 │   │   traceback = None                                                                   │
│   121 │   │   if (                                                                               │
│   122 │   │   │   self.rich_tracebacks                                                           │
│                                                                                                  │
│ /usr/lib/python3.9/logging/__init__.py:927 in format                                             │
│                                                                                                  │
│    924 │   │   │   fmt = self.formatter                                                          │
│    925 │   │   else:                                                                             │
│    926 │   │   │   fmt = _defaultFormatter                                                       │
│ ❱  927 │   │   return fmt.format(record)                                                         │
│    928 │                                                                                         │
│    929 │   def emit(self, record):                                                               │
│    930 │   │   """                                                                               │
│                                                                                                  │
│ /usr/lib/python3.9/logging/__init__.py:663 in format                                             │
│                                                                                                  │
│    660 │   │   called to format the event time. If there is exception information,               │
│    661 │   │   it is formatted using formatException() and appended to the message.              │
│    662 │   │   """                                                                               │
│ ❱  663 │   │   record.message = record.getMessage()                                              │
│    664 │   │   if self.usesTime():                                                               │
│    665 │   │   │   record.asctime = self.formatTime(record, self.datefmt)                        │
│    666 │   │   s = self.formatMessage(record)                                                    │
│                                                                                                  │
│ /usr/lib/python3.9/logging/__init__.py:367 in getMessage                                         │
│                                                                                                  │
│    364 │   │   """                                                                               │
│    365 │   │   msg = str(self.msg)                                                               │
│    366 │   │   if self.args:                                                                     │
│ ❱  367 │   │   │   msg = msg % self.args                                                         │
│    368 │   │   return msg                                                                        │
│    369                                                                                           │
│    370 #                                                                                         │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: not all arguments converted during string formatting
```

<!-- Insert screenshots here (only when absolutely necessary, we prefer copy/pasted output!) -->

</details>


## System specifications

<details><summary>System Details</summary>

- OS:  Ubuntu 21.10
- RAM:  32GB
- Python version (`python/py/python3 --version`):  3.9.7

</details>



Discussion:

Resolving patch:
diff --git a/manim/camera/camera.py b/manim/camera/camera.py
--- a/manim/camera/camera.py
+++ b/manim/camera/camera.py
@@ -354,16 +354,10 @@ def make_background_from_func(self, coords_to_colors_func):
             The pixel array which can then be passed to set_background.
         """
 
-        logger.info(
-            "Starting set_background; for reference, the current time is ",
-            time.strftime("%H:%M:%S"),
-        )
+        logger.info("Starting set_background")
         coords = self.get_coords_of_all_pixels()
         new_background = np.apply_along_axis(coords_to_colors_func, 2, coords)
-        logger.info(
-            "Ending set_background; for reference, the current time is ",
-            time.strftime("%H:%M:%S"),
-        )
+        logger.info("Ending set_background")
 
         return self.convert_pixel_array(new_background, convert_from_floats=True)
 


Test patch: